From 392d3225ce520505751dd8c8c19de2ca892804e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 22 Aug 2012 09:20:55 +0100 Subject: [PATCH] rtp: fix buffer leak when gst_rtp_buffer_map() fails because of broken data Makes libs/rtp unit test valgrind clean. --- gst-libs/gst/rtp/gstrtpbuffer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst-libs/gst/rtp/gstrtpbuffer.c b/gst-libs/gst/rtp/gstrtpbuffer.c index 86fc808ed2..f6f8bcc0b8 100644 --- a/gst-libs/gst/rtp/gstrtpbuffer.c +++ b/gst-libs/gst/rtp/gstrtpbuffer.c @@ -443,7 +443,14 @@ wrong_padding: } dump_packet: { + gint i; + GST_MEMDUMP ("buffer", data, size); + + for (i = 0; i < G_N_ELEMENTS (rtp->map); ++i) { + if (rtp->data[i] != NULL) + gst_buffer_unmap (buffer, &rtp->map[i]); + } return FALSE; } }