asfdepay: guard against dropped buffers
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 22 Jun 2009 15:36:21 +0000 (17:36 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 22 Jun 2009 15:36:21 +0000 (17:36 +0200)
If a buffer was dropped, we might request data from the adapter that is not
there and then we get a NULL buffer.

gst/asfdemux/gstrtpasfdepay.c

index 888ebfa..b23d1c5 100644 (file)
@@ -324,7 +324,6 @@ gst_rtp_asf_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
       GstBuffer *sub;
 
       /* Fragmented packet handling */
-
       outbuf = NULL;
 
       if (len_offs == 0 && (available = gst_adapter_available (depay->adapter))) {
@@ -352,7 +351,8 @@ gst_rtp_asf_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
               available, len_offs);
           sub = gst_adapter_take_buffer (depay->adapter, len_offs);
           gst_adapter_clear (depay->adapter);
-          gst_adapter_push (depay->adapter, sub);
+          if (sub)
+            gst_adapter_push (depay->adapter, sub);
         }
       }
       sub = gst_rtp_buffer_get_payload_subbuffer (buf, offset, packet_len);