Add error return logic if invalid player_display_mode_e is given 22/72322/1
authorJihae Yi <jihae.yi@samsung.com>
Tue, 31 May 2016 11:12:13 +0000 (20:12 +0900)
committerJihae Yi <jihae.yi@samsung.com>
Tue, 31 May 2016 11:12:47 +0000 (20:12 +0900)
Change-Id: I30a60f006e851e3a61a3f4e44e5631f87f5f853e

include/common/player.h [changed mode: 0644->0755]
include/wearable/player.h [changed mode: 0644->0755]
src/player.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index faafab7..ec7b596
@@ -196,6 +196,7 @@ typedef enum {
        PLAYER_DISPLAY_MODE_CROPPED_FULL,       /**< Cropped full-screen */
        PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER,   /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */
        PLAYER_DISPLAY_MODE_DST_ROI,            /**< Dst ROI mode (Deprecated since [3.0]).*/
+       PLAYER_DISPLAY_MODE_NUM
 } player_display_mode_e;
 
 /**
old mode 100644 (file)
new mode 100755 (executable)
index c648c6a..4ad3248
@@ -195,6 +195,7 @@ typedef enum {
        PLAYER_DISPLAY_MODE_CROPPED_FULL,       /**< Cropped full-screen */
        PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER,   /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */
        PLAYER_DISPLAY_MODE_DST_ROI,                    /**< Dst ROI mode (Deprecated since [3.0]).*/
+       PLAYER_DISPLAY_MODE_NUM
 } player_display_mode_e;
 
 /**
old mode 100644 (file)
new mode 100755 (executable)
index bc0c45c..0e806ba
@@ -1973,6 +1973,7 @@ int player_set_display(player_h player, player_display_type_e type, player_displ
 int player_set_display_mode(player_h player, player_display_mode_e mode)
 {
        PLAYER_INSTANCE_CHECK(player);
+       PLAYER_CHECK_CONDITION(PLAYER_DISPLAY_MODE_LETTER_BOX <= mode && mode < PLAYER_DISPLAY_MODE_NUM, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
        int ret = PLAYER_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_SET_DISPLAY_MODE;
        player_cli_s *pc = (player_cli_s *) player;