Commit aec19c10 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

pcapparse: fix regression when handling packets with eth padding

Introduced by c4c9fe60 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
parent 9e7454a9
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment