mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
directshow: Validate enumerated AM_MEDIA_TYPE struct
The video info struct can be null if format is undefined Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3323>
This commit is contained in:
parent
786b7699d1
commit
bfed80a82c
1 changed files with 8 additions and 0 deletions
|
@ -97,7 +97,15 @@ gst_dshow_new_pin_mediatype_from_enum_mediatypes (IPin * pin, IEnumMediaTypes *e
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* FORMAT_None or GUID_NULL format type does hold format data */
|
||||
if (pin_mediatype->mediatype->formattype == FORMAT_None ||
|
||||
pin_mediatype->mediatype->formattype == GUID_NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
video_info = (VIDEOINFOHEADER *) pin_mediatype->mediatype->pbFormat;
|
||||
if (!video_info)
|
||||
return NULL;
|
||||
|
||||
pin_mediatype->defaultWidth = video_info->bmiHeader.biWidth;
|
||||
pin_mediatype->defaultHeight = video_info->bmiHeader.biHeight;
|
||||
|
|
Loading…
Reference in a new issue