id3tag: fix memory leak 26/119426/1 accepted/tizen/3.0/common/20170320.130417 accepted/tizen/3.0/ivi/20170320.080423 accepted/tizen/3.0/mobile/20170320.074836 accepted/tizen/3.0/tv/20170320.075824 accepted/tizen/3.0/wearable/20170320.080121 submit/tizen_3.0/20170317.034449
authorGilbok Lee <gilbok.lee@samsung.com>
Thu, 22 Dec 2016 12:13:50 +0000 (21:13 +0900)
committereunhae choi <eunhae1.choi@samsung.com>
Fri, 17 Mar 2017 03:24:26 +0000 (20:24 -0700)
Change-Id: I9d81bcb5aed9c737da641413ae3d7fc756686fd1
(cherry picked from commit 0996b4217a1f2630a851817a9994362b8afb1f3c)

gst/id3tag/id3tag.c

index c12a77c5988265439490d47993abd1cdc7547802..614fd8986caf68369e211d13b511919c2549ca09 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");