Fixed memory leak during updating album art 76/144776/1
authorJaechan Lee <jaechan3.lee@samsung.com>
Fri, 18 Aug 2017 01:34:14 +0000 (10:34 +0900)
committerJaechan Lee <jaechan3.lee@samsung.com>
Fri, 18 Aug 2017 01:34:34 +0000 (10:34 +0900)
[Model] Gear Sports
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] N/A
[Occurrence Version] N/A

[Problem] Memory is leaked during playing mp3 files.
[Cause & Measure] Cause : Given sample by calling gst_tag_list_get_sample_index should be freed by calling gst_sample_unref.
Measure : Fixed memory leak during updating album art.
[Checking Method] N/A

[Team] MM FRAMEWORK
[Developer] JaeChan Lee
[Solution company] Samsung
[Change Type] Specification change

Change-Id: I7ba8ea76acdad3d6c9696f9ee57c75511fbe338e

src/mm_player_priv.c

index 0e8a8b32bfa319a6d3ce9776bf6bb65d796c49f4..93e8b848940d2d1472331b38890a9e6cd9411de8 100644 (file)
@@ -1784,6 +1784,7 @@ do {      \
                buffer = gst_sample_get_buffer(sample);\
                if (!gst_buffer_map(buffer, &info, GST_MAP_READ)) {\
                        LOGD("failed to get image data from tag");\
+                       gst_sample_unref(sample);\
                        return FALSE;\
                } \
                SECURE_LOGD("update album cover data : %p, size : %d\n", info.data, info.size);\
@@ -1800,6 +1801,7 @@ do {      \
                        } \
                } \
                gst_buffer_unmap(buffer, &info);\
+               gst_sample_unref(sample);\
        }       \
 } while (0)