mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
pcapparse: don't crash on 0-sized packets
https://bugzilla.gnome.org/show_bug.cgi?id=756573
This commit is contained in:
parent
f027bb39f9
commit
9a20a7c77b
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue