Commit ac531be9 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Check the format GUID, size, and pointer in amt_to_gst_caps().

Some application filters enumerate types without a format block. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 0c1d9312
......@@ -387,6 +387,10 @@ static GstCaps *amt_to_gst_caps_video(const AM_MEDIA_TYPE *mt)
unsigned int i;
GstCaps *caps;
if (!IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo)
|| mt->cbFormat < sizeof(VIDEOINFOHEADER) || !mt->pbFormat)
return NULL;
for (i = 0; i < ARRAY_SIZE(format_map); ++i)
{
if (IsEqualGUID(&mt->subtype, format_map[i].subtype))
......@@ -425,6 +429,10 @@ static GstCaps *amt_to_gst_caps_audio(const AM_MEDIA_TYPE *mt)
GstAudioFormat format = GST_AUDIO_FORMAT_UNKNOWN;
GstAudioInfo info;
if (!IsEqualGUID(&mt->formattype, &FORMAT_WaveFormatEx)
|| mt->cbFormat < sizeof(WAVEFORMATEX) || !mt->pbFormat)
return NULL;
if (IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_PCM))
format = gst_audio_format_build_integer(wfx->wBitsPerSample != 8,
G_LITTLE_ENDIAN, wfx->wBitsPerSample, wfx->wBitsPerSample);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment