Rémi Bernon (@rbernon) commented about dlls/winegstreamer/wmv_decoder.c:
- info = (VIDEOINFOHEADER *)type->pbFormat;
- if (info->bmiHeader.biSize != sizeof(info->bmiHeader)
|| !info->bmiHeader.biWidth
|| !info->bmiHeader.biHeight
|| !info->bmiHeader.biCompression
|| info->bmiHeader.biWidth > 4096
|| info->bmiHeader.biHeight > 4096
|| info->bmiHeader.biWidth < 0
|| info->bmiHeader.biHeight < -4096)
return DMO_E_TYPE_NOT_ACCEPTED;
- if (!(flags & DMO_SET_TYPEF_TEST_ONLY))
- {
memcpy(&decoder->input_type, type, sizeof(*type));
decoder->input_type.pbFormat = (BYTE *)&decoder->input_info;
memcpy(&decoder->input_info, type, sizeof(*info));
I think you may need to use strmbase `CopyMediaType` to do that correctly, the media type may have things like `pUnk` set, even though we probably won't use it.
Another option that may be more future proof regarding MF interop would be to keep a `struct wg_format` on the decoder rather than a `DMO_MEDIA_TYPE` and `VIDEOINFOHEADER`, and use `amt_to_wg_format` here. That would require adding WMV format support first, but you'll need that anyway at some point.
I'm also not completely sure we need all these checks (or the corresponding tests), but I don't mind too much.