From 27619783a467e96f3229cd65d9ec288b7fc3ffdd Mon Sep 17 00:00:00 2001 From: Jihae Yi Date: Tue, 31 May 2016 20:12:13 +0900 Subject: [PATCH] Add error return logic if invalid player_display_mode_e is given Change-Id: I30a60f006e851e3a61a3f4e44e5631f87f5f853e --- include/common/player.h | 1 + include/wearable/player.h | 1 + src/player.c | 1 + 3 files changed, 3 insertions(+) mode change 100644 => 100755 include/common/player.h mode change 100644 => 100755 include/wearable/player.h mode change 100644 => 100755 src/player.c diff --git a/include/common/player.h b/include/common/player.h old mode 100644 new mode 100755 index faafab7..ec7b596 --- a/include/common/player.h +++ b/include/common/player.h @@ -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; /** diff --git a/include/wearable/player.h b/include/wearable/player.h old mode 100644 new mode 100755 index c648c6a..4ad3248 --- a/include/wearable/player.h +++ b/include/wearable/player.h @@ -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; /** diff --git a/src/player.c b/src/player.c old mode 100644 new mode 100755 index bc0c45c..0e806ba --- a/src/player.c +++ b/src/player.c @@ -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; -- 2.7.4