diff options
author | Gilbok Lee <gilbok.lee@samsung.com> | 2024-09-30 11:00:25 +0900 |
---|---|---|
committer | Gilbok Lee <gilbok.lee@samsung.com> | 2024-09-30 15:53:24 +0900 |
commit | 74475bbef3b98cf57177b50bde1eef1e2518ed50 (patch) | |
tree | 36b109f74738b03757ed15211836bc713f2af577 | |
parent | af3b573470a01e309462b7545436cc153382d691 (diff) | |
download | libmm-player-tizen_9.0.tar.gz libmm-player-tizen_9.0.tar.bz2 libmm-player-tizen_9.0.zip |
[1.1.2] Add return check for system_info_get_platform_string() to prevent crashHEADtizen_9.0_m2_releaseaccepted/tizen/unified/x/asan/20241013.235858accepted/tizen/unified/x/20241006.081955accepted/tizen/unified/toolchain/20241022.122858accepted/tizen/unified/toolchain/20241022.122420accepted/tizen/unified/20241004.041852accepted/tizen/9.0/unified/20241030.235032tizen_9.0tizenaccepted/tizen_unified_x_asanaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unifiedaccepted/tizen_9.0_unified
Change-Id: Ib8c507d9e59f0afaa8a6d3a387eeffa40cabed02
-rw-r--r-- | packaging/libmm-player.spec | 2 | ||||
-rw-r--r-- | src/mm_player_priv.c | 27 |
2 files changed, 20 insertions, 9 deletions
diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 4b6dfe8..a168908 100644 --- a/packaging/libmm-player.spec +++ b/packaging/libmm-player.spec @@ -1,6 +1,6 @@ Name: libmm-player Summary: Multimedia Framework Player Library -Version: 1.1.1 +Version: 1.1.2 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index 4f313a5..f465103 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -6366,16 +6366,26 @@ _mmplayer_pipeline_complete(GstElement *decodebin, gpointer data) MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-status-complete"); } -static int -__mmplayer_check_profile(void) +static bool +__mmplayer_is_tv_profile(void) { - char *profileName; + char *profileName = NULL; static int profile_tv = -1; if (__builtin_expect(profile_tv != -1, 1)) - return profile_tv; + return (profile_tv == 1); + + if (system_info_get_platform_string("http://tizen.org/feature/profile", &profileName) + != SYSTEM_INFO_ERROR_NONE) { + LOGE("fail to get profile name"); + return false; + } + + if (!profileName) { + LOGE("profileName is NULL"); + return false; + } - system_info_get_platform_string("http://tizen.org/feature/profile", &profileName); switch (*profileName) { case 't': case 'T': @@ -6385,9 +6395,10 @@ __mmplayer_check_profile(void) profile_tv = 0; break; } + free(profileName); - return profile_tv; + return (profile_tv == 1); } static gboolean @@ -6458,7 +6469,7 @@ __mmplayer_verify_gapless_play_path(mmplayer_t *player) gint count = 0; gint gapless = 0; guint num_of_uri = 0; - int profile_tv = -1; + bool profile_tv = false; MMPLAYER_FENTER(); @@ -6486,7 +6497,7 @@ __mmplayer_verify_gapless_play_path(mmplayer_t *player) MM_PLAYER_GAPLESS_MODE, &gapless, NULL); /* gapless playback is not supported in case of video at TV profile. */ - profile_tv = __mmplayer_check_profile(); + profile_tv = __mmplayer_is_tv_profile(); if (profile_tv && video) { LOGW("not support video gapless playback"); goto ERROR; |