rtpjpegdepay: sanity check for NULL qtable
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 30 Apr 2014 10:52:10 +0000 (11:52 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 30 Apr 2014 10:52:10 +0000 (11:52 +0100)
Can happen (at least in crafted stream)

Coverity 1208778

gst/rtp/gstrtpjpegdepay.c

index 04d0104..5463283 100644 (file)
@@ -665,6 +665,12 @@ gst_rtp_jpeg_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
           goto no_qtable;
       }
     }
+
+    /* I think we can get here with a NULL qtable, so make sure we don't
+       go dereferencing it in MakeHeaders if we do */
+    if (!qtable)
+      goto no_qtable;
+
     /* max header length, should be big enough */
     outbuf = gst_buffer_new_and_alloc (1000);
     gst_buffer_map (outbuf, &map, GST_MAP_WRITE);