gst-plugins-bad: mpegvideoparser: fix memory leak

Vincent Penquerc'h vincent at kemper.freedesktop.org
Thu Jan 12 06:44:44 PST 2012


Module: gst-plugins-bad
Branch: master
Commit: b6edb1a03aefee0006d7d163d28448d1d5cd5140
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=b6edb1a03aefee0006d7d163d28448d1d5cd5140

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Thu Jan 12 14:34:25 2012 +0000

mpegvideoparser: fix memory leak

---

 gst-libs/gst/codecparsers/gstmpegvideoparser.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/gst-libs/gst/codecparsers/gstmpegvideoparser.c b/gst-libs/gst/codecparsers/gstmpegvideoparser.c
index 009c02b..b725d9d 100644
--- a/gst-libs/gst/codecparsers/gstmpegvideoparser.c
+++ b/gst-libs/gst/codecparsers/gstmpegvideoparser.c
@@ -332,8 +332,10 @@ gst_mpeg_video_parse (const guint8 * data, gsize size, guint offset)
     codoffsize->offset = gst_byte_reader_get_pos (&br) + offset;
 
     rsize = gst_byte_reader_get_remaining (&br);
-    if (rsize <= 0)
+    if (rsize <= 0) {
+      g_free (codoffsize);
       break;
+    }
 
     off = scan_for_start_codes (&br, 0, rsize);
 



More information about the gstreamer-commits mailing list