[v0.3.31] fix bug about setting subtitle_path to NULL 22/95022/1
authorNAMJEONGYOON <just.nam@samsung.com>
Wed, 2 Nov 2016 06:34:44 +0000 (15:34 +0900)
committerNAMJEONGYOON <just.nam@samsung.com>
Wed, 2 Nov 2016 06:34:44 +0000 (15:34 +0900)
Change-Id: I281691bf752ea3a4ffd9c37e38112d7956e6e4ef

src/player.c

index b0e04fc1eb0c4686ad472742108b93817d3b114b..abb71287842b1f7ea9b283beec4fbf195b2cfa6f 100644 (file)
@@ -3102,7 +3102,6 @@ int player_audio_effect_equalizer_is_available(player_h player, bool * pavailabl
 int player_set_subtitle_path(player_h player, const char *path)
 {
        PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(path);
        int ret = PLAYER_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_SET_SUBTITLE_PATH;
        player_cli_s *pc = (player_cli_s *) player;
@@ -3113,7 +3112,8 @@ int player_set_subtitle_path(player_h player, const char *path)
 
        if (storage_get_origin_internal_path(path, MAX_URL_LEN, subtitle_path) < 0) {
                /* cannot convert path. use the original one. */
-               strncpy(subtitle_path, path, MAX_URL_LEN-1);
+               if (path != NULL)
+                       strncpy(subtitle_path, path, MAX_URL_LEN-1);
        } else {
                /* need to use converted path. */
                LOGD("Converted path : %s -> %s", path, subtitle_path);