rtpbuffer: fix memory leak when gst_rtp_buffer_map fails

Make sure rtp->data[3] is set before jumping to error path.

https://bugzilla.gnome.org/show_bug.cgi?id=729117
This commit is contained in:
Stian Selnes 2014-04-29 08:46:02 +02:00 committed by Sebastian Dröge
parent 96efc280d5
commit 0011d8cbb5

View file

@ -403,11 +403,11 @@ gst_rtp_buffer_map (GstBuffer * buffer, GstMapFlags flags, GstRTPBuffer * rtp)
goto map_failed;
padding = rtp->map[3].data[skip];
if (skip + 1 < padding)
goto wrong_length;
rtp->data[3] = rtp->map[3].data + skip + 1 - padding;
rtp->size[3] = padding;
if (skip + 1 < padding)
goto wrong_length;
} else {
rtp->data[3] = NULL;
rtp->size[3] = 0;