rtpbuffer: Fix ensure_buffers() if whole packet is in one GstMemory
authorMiguel Paris <mparisparis@gmail.com>
Fri, 25 Nov 2016 09:48:06 +0000 (10:48 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 25 Nov 2016 11:15:24 +0000 (13:15 +0200)
commit036bdf5d2d44facdcf4116ac90d3df29cbd96b8d
treeab10590935a41932d5baccaa828264279d2b223a
parent47fdb15074fb4bebf20bf63f857b82d784b96919
rtpbuffer: Fix ensure_buffers() if whole packet is in one GstMemory

When gst_rtp_buffer_add_extension_onebyte_header() is used over a
GstRtpBuffer that only contains a memory for the whole packet,
ensure_buffers function crashes at the next point:

mem = gst_memory_copy (rtp->map[i].memory, offset, rtp->size[i]);

when i==2 because the payload is not mapped.

In addition the offset is calculated subtracting in the wrong direction.

https://bugzilla.gnome.org/show_bug.cgi?id=774959
gst-libs/gst/rtp/gstrtpbuffer.c