[v0.3.44] handle null path of subtitle 57/110257/1 accepted/tizen/common/20170116.181454 accepted/tizen/ivi/20170116.090208 accepted/tizen/mobile/20170116.090109 accepted/tizen/tv/20170116.090130 accepted/tizen/wearable/20170116.090149 submit/tizen/20170116.043636
authorEunhae Choi <eunhae1.choi@samsung.com>
Fri, 13 Jan 2017 10:52:27 +0000 (19:52 +0900)
committereunhae choi <eunhae1.choi@samsung.com>
Fri, 13 Jan 2017 11:14:48 +0000 (03:14 -0800)
Change-Id: I841eaddc110f361323c6c207a0917c3531839c0c

packaging/capi-media-player.spec
src/player.c

index 971977f..b662cc1 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-player
 Summary:    A Media Player API
-Version:    0.3.43
+Version:    0.3.44
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index c0865e5..95bbf82 100644 (file)
@@ -1923,6 +1923,11 @@ int _player_get_origin_internal_path(const char* uri, char* origin)
        gchar *file_path = NULL;
        GError *err = NULL;
 
+       if (!uri || !origin) {
+               LOGD("invalid parameter");
+               return PLAYER_ERROR_INVALID_PARAMETER;
+       }
+
        if (strstr(uri, "file://")) {
                file_path = g_filename_from_uri(uri, NULL, &err);
 
@@ -3283,7 +3288,7 @@ int player_set_subtitle_path(player_h player, const char *path)
 
        LOGD("ENTER");
 
-       if (_player_get_origin_internal_path(path, subtitle_path) != PLAYER_ERROR_NONE)
+       if (path && _player_get_origin_internal_path(path, subtitle_path) != PLAYER_ERROR_NONE)
                return PLAYER_ERROR_INVALID_PARAMETER;
 
        player_msg_send1(api, pc, ret_buf, ret, STRING, subtitle_path);