summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2015-12-23 20:24:46 +0000
committerTim-Philipp Müller <tim@centricular.com>2015-12-23 23:14:17 +0000
commit9a20a7c77bd33b92bd195fc508fb566394c4dd11 (patch)
tree0712dc43f8286dc8c08d7e3db00b3df62634ed78
parentf027bb39f914189366fe76bc3370a8084753d1d8 (diff)
pcapparse: don't crash on 0-sized packets
https://bugzilla.gnome.org/show_bug.cgi?id=756573
-rw-r--r--gst/pcapparse/gstpcapparse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst/pcapparse/gstpcapparse.c b/gst/pcapparse/gstpcapparse.c
index c82eb3477..21e0cab26 100644
--- a/gst/pcapparse/gstpcapparse.c
+++ b/gst/pcapparse/gstpcapparse.c
@@ -490,7 +490,11 @@ gst_pcap_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
* buffer with a single memory, since the RTP depayloaders expect
* the complete RTP header to be in the first memory if there are
* multiple ones and we can't guarantee that with _fast() */
- out_buf = gst_adapter_take_buffer (self->adapter, payload_size);
+ if (payload_size > 0) {
+ out_buf = gst_adapter_take_buffer (self->adapter, payload_size);
+ } else {
+ out_buf = gst_buffer_new ();
+ }
gst_adapter_flush (self->adapter,
self->cur_packet_size - offset - payload_size);