[0.6.252] Fix wrong memory free, when the pipeline is destroyed 68/257168/2 accepted/tizen/6.0/unified/20210512.125254 submit/tizen_6.0/20210511.044933
authorGilbok Lee <gilbok.lee@samsung.com>
Tue, 20 Apr 2021 08:31:24 +0000 (17:31 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Tue, 20 Apr 2021 08:44:25 +0000 (17:44 +0900)
- videobin is already freed in _mmplayer_gst_decode_pad_removed()

Change-Id: Ic92d041eeb6e3967c08ac30cf3c8125e72be510e

packaging/libmm-player.spec
src/mm_player_priv.c

index 28a641e5d9fb2b2c6eee6e016598f10760ea857d..865835995ab0a1ef39a6beb20cccaae091453162 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.251
+Version:    0.6.252
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index fbe4cb7486c08bef24ba29f10814ff811c93b763..8db03cc151a40f33725e810b56f35e144567ee52 100644 (file)
@@ -4369,9 +4369,6 @@ __mmplayer_gst_destroy_pipeline(mmplayer_t *player)
                __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_ALL);
 
                if (mainbin) {
-                       mmplayer_gst_element_t *audiobin = player->pipeline->audiobin;
-                       mmplayer_gst_element_t *videobin = player->pipeline->videobin;
-                       mmplayer_gst_element_t *textbin = player->pipeline->textbin;
                        GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(mainbin[MMPLAYER_M_PIPE].gst));
                        gst_bus_set_sync_handler(bus, NULL, NULL, NULL);
                        gst_object_unref(bus);
@@ -4391,9 +4388,9 @@ __mmplayer_gst_destroy_pipeline(mmplayer_t *player)
                        if (mainbin[MMPLAYER_M_SRC_FAKESINK].gst)
                                gst_object_unref(GST_OBJECT(mainbin[MMPLAYER_M_SRC_FAKESINK].gst));
 
-                       MMPLAYER_FREEIF(audiobin);
-                       MMPLAYER_FREEIF(videobin);
-                       MMPLAYER_FREEIF(textbin);
+                       MMPLAYER_FREEIF(player->pipeline->audiobin);
+                       MMPLAYER_FREEIF(player->pipeline->videobin);
+                       MMPLAYER_FREEIF(player->pipeline->textbin);
                        MMPLAYER_FREEIF(mainbin);
                }
 
@@ -7515,10 +7512,12 @@ _mmplayer_gst_decode_pad_removed(GstElement *elem, GstPad *pad,
 
        __mmplayer_release_signal_connection(player, MM_PLAYER_SIGNAL_TYPE_VIDEOBIN);
 
-       ret = _mmplayer_gst_set_state(player, mainbin[MMPLAYER_M_V_CONCAT].gst, GST_STATE_NULL, FALSE, timeout);
-       if (ret != MM_ERROR_NONE) {
-               LOGE("fail to change state to NULL");
-               return;
+       if (!gst_bin_remove(GST_BIN_CAST(mainbin[MMPLAYER_M_PIPE].gst), videobin[MMPLAYER_V_BIN].gst)) {
+               LOGE("failed to remove videobin");
+       }
+
+       if (!gst_bin_remove(GST_BIN_CAST(mainbin[MMPLAYER_M_PIPE].gst), mainbin[MMPLAYER_M_V_CONCAT].gst)) {
+               LOGE("failed to remove video concat");
        }
 
        ret = _mmplayer_gst_set_state(player, videobin[MMPLAYER_V_BIN].gst, GST_STATE_NULL, FALSE, timeout);
@@ -7527,12 +7526,10 @@ _mmplayer_gst_decode_pad_removed(GstElement *elem, GstPad *pad,
                return;
        }
 
-       if (!gst_bin_remove(GST_BIN_CAST(mainbin[MMPLAYER_M_PIPE].gst), mainbin[MMPLAYER_M_V_CONCAT].gst)) {
-               LOGE("failed to remove video concat");
-       }
-
-       if (!gst_bin_remove(GST_BIN_CAST(mainbin[MMPLAYER_M_PIPE].gst), videobin[MMPLAYER_V_BIN].gst)) {
-               LOGE("failed to remove videobin");
+       ret = _mmplayer_gst_set_state(player, mainbin[MMPLAYER_M_V_CONCAT].gst, GST_STATE_NULL, FALSE, timeout);
+       if (ret != MM_ERROR_NONE) {
+               LOGE("fail to change state to NULL");
+               return;
        }
 
        gst_object_unref(GST_OBJECT(mainbin[MMPLAYER_M_V_CONCAT].gst));