summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbok Lee <gilbok.lee@samsung.com>2021-04-20 17:31:24 +0900
committerGilbok Lee <gilbok.lee@samsung.com>2021-04-21 10:10:15 +0900
commit9cfc2d4c02ee9621a9ec86fa58abc8032528f6d7 (patch)
treeb1b072b62ed38ae07c0dbcb9cb4ae1c5f4dfa740
parent6c39d12f5c8cc4f402a4d0ee47f06de6bcaa46a6 (diff)
downloadlibmm-player-9cfc2d4c02ee9621a9ec86fa58abc8032528f6d7.tar.gz
libmm-player-9cfc2d4c02ee9621a9ec86fa58abc8032528f6d7.tar.bz2
libmm-player-9cfc2d4c02ee9621a9ec86fa58abc8032528f6d7.zip
[0.6.253] Fix wrong memory free, when the pipeline is destroyedsubmit/tizen/20210421.110538accepted/tizen/unified/20210422.005409
- videobin is already freed in _mmplayer_gst_decode_pad_removed() Change-Id: Ic92d041eeb6e3967c08ac30cf3c8125e72be510e
-rw-r--r--packaging/libmm-player.spec2
-rw-r--r--src/mm_player_priv.c29
2 files changed, 14 insertions, 17 deletions
diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec
index 8658359..03fc1c1 100644
--- a/packaging/libmm-player.spec
+++ b/packaging/libmm-player.spec
@@ -1,6 +1,6 @@
Name: libmm-player
Summary: Multimedia Framework Player Library
-Version: 0.6.252
+Version: 0.6.253
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c
index 77743ac..6e3f150 100644
--- a/src/mm_player_priv.c
+++ b/src/mm_player_priv.c
@@ -4373,9 +4373,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);
@@ -4395,9 +4392,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);
}
@@ -7519,10 +7516,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);
@@ -7531,12 +7530,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));