asfpacket: skip empty payload packets
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Thu, 8 Sep 2011 15:01:27 +0000 (17:01 +0200)
committerNikhil Devshatwar <a0132237@ti.com>
Fri, 17 May 2013 09:40:38 +0000 (15:10 +0530)
... which also avoids assertion failures and possible segfaults later on
when possibly trying to join 2 empty buffers.

gst/asfdemux/asfpacket.c

index b56c81a7982eca293c8688eb9ea987185a80f9fb..552a559dc35c8717b84383dc2912790c95698ef7 100644 (file)
@@ -381,7 +381,8 @@ gst_asf_demux_parse_payload (GstASFDemux * demux, AsfPacket * packet,
 
     GST_LOG_OBJECT (demux, "payload length: %u", payload_len);
 
-    if ((stream = gst_asf_demux_get_stream (demux, stream_num))) {
+    if ((stream = gst_asf_demux_get_stream (demux, stream_num))
+        && payload_len) {
       payload.buf = asf_packet_create_payload_buffer (packet, p_data, p_size,
           payload_len);