[0.3.95] Add argument check in some APIs 81/181481/1
authorGilbok Lee <gilbok.lee@samsung.com>
Thu, 14 Jun 2018 06:35:02 +0000 (15:35 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Thu, 14 Jun 2018 06:35:25 +0000 (15:35 +0900)
- player_set_max_adaptive_variant_limit
- player_set_streaming_buffering_time

Change-Id: Id9b579bb4ebbb3881bc40150b627896b0a1ce9c4

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

index 32618f2..4b1be2c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-player
 Summary:    A Media Player API
-Version:    0.3.94
+Version:    0.3.95
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 52aeabb..79ef74e 100644 (file)
@@ -4543,6 +4543,8 @@ int player_set_max_adaptive_variant_limit(player_h player, int bandwidth, int wi
 {
        int ret = PLAYER_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
+       PLAYER_CHECK_CONDITION(bandwidth >= -1 && width >= -1 && height >= -1,
+                       PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
        player_cli_s *pc = (player_cli_s *) player;
        muse_player_api_e api = MUSE_PLAYER_API_SET_MAX_ADAPTIVE_VARIANT_LIMIT;
        char *ret_buf = NULL;
@@ -4664,6 +4666,8 @@ int player_set_streaming_buffering_time(player_h player, int buffer_ms, int rebu
 {
        int ret = PLAYER_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
+       PLAYER_CHECK_CONDITION(buffer_ms >= 0 && rebuffer_ms >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+
        player_cli_s *pc = (player_cli_s *) player;
        muse_player_api_e api = MUSE_PLAYER_API_SET_STREAMING_BUFFERING_TIME;
        char *ret_buf = NULL;