diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2015-06-15 12:55:39 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2015-07-03 10:25:15 +0100 |
commit | aec19c10537124b1dbf1eb4cfa65ef68778fcd67 (patch) | |
tree | 8ea5711e8d0ae985845da900d005e39199f8ae16 | |
parent | 9e7454a90abe7ea6075e3bcaa0731ed4a8a22b54 (diff) | |
download | gstreamer-plugins-bad-aec19c10537124b1dbf1eb4cfa65ef68778fcd67.tar.gz |
pcapparse: fix regression when handling packets with eth padding
Introduced by c4c9fe60b pcapparse: Take buffer directly from the adapter
Flush any trailing bytes after the payload from the adapter as well,
otherwise we'll read a bogus packet size from the adapter next and
then everything goes downhill from there.
https://bugzilla.gnome.org/show_bug.cgi?id=751879
-rw-r--r-- | gst/pcapparse/gstpcapparse.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gst/pcapparse/gstpcapparse.c b/gst/pcapparse/gstpcapparse.c index 1a5388e88..75d4cb92a 100644 --- a/gst/pcapparse/gstpcapparse.c +++ b/gst/pcapparse/gstpcapparse.c @@ -480,13 +480,12 @@ gst_pcap_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) GstBuffer *out_buf; guintptr offset = payload_data - data; - self->cur_packet_size -= offset; - self->cur_packet_size -= payload_size; - gst_adapter_unmap (self->adapter); gst_adapter_flush (self->adapter, offset); out_buf = gst_adapter_take_buffer_fast (self->adapter, payload_size); + gst_adapter_flush (self->adapter, + self->cur_packet_size - offset - payload_size); if (GST_CLOCK_TIME_IS_VALID (self->cur_ts)) { if (!GST_CLOCK_TIME_IS_VALID (self->base_ts)) |