id3tag: fix memory leak 09/106709/2
authorGilbok Lee <gilbok.lee@samsung.com>
Thu, 22 Dec 2016 12:13:50 +0000 (21:13 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Thu, 22 Dec 2016 12:14:23 +0000 (21:14 +0900)
Change-Id: I9d81bcb5aed9c737da641413ae3d7fc756686fd1

gst/id3tag/id3tag.c

index c12a77c..614fd89 100644 (file)
@@ -519,10 +519,12 @@ add_id3v2frame_tag (GstId3v2Tag * id3v2tag, const GstTagList * list,
 
           g_array_append_val (id3v2tag->frames, frame);
           GST_DEBUG ("Added unparsed tag with %d bytes", size);
-          gst_buffer_unmap (buf, &mapinfo);
         } else {
           GST_WARNING ("Short ID3v2 frame");
         }
+
+        gst_buffer_unmap (buf, &mapinfo);
+
       } else {
         GST_WARNING ("Discarding unrecognised ID3 tag for different ID3 "
             "version");
@@ -657,7 +659,7 @@ add_comment_tag (GstId3v2Tag * id3v2tag, const GstTagList * list,
         val = g_strdup (s);
       }
 
-      /* If we don't have a valid language, match what taglib does for 
+      /* If we don't have a valid language, match what taglib does for
          unknown languages */
       if (!lang || strlen (lang) < 3)
         lang = g_strdup ("XXX");