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

Alexandre Julliard julliard at winehq.org
Mon Apr 6 15:53:20 CDT 2020


Module: wine
Branch: master
Commit: ac531be92eecfde35fc48fb50e9070d21d6578c8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ac531be92eecfde35fc48fb50e9070d21d6578c8

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Sun Apr  5 19:43:35 2020 -0500

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: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winegstreamer/gstdemux.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 2d9efe8ead..2186192b59 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -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);




More information about the wine-cvs mailing list