From: Gilbok Lee Date: Mon, 16 Oct 2017 08:51:38 +0000 (+0900) Subject: [0.2.65] Fix Coverity issues X-Git-Tag: submit/tizen_4.0/20171017.101825^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=276e24be10f347db1b51c0604704d150958afee4;p=platform%2Fcore%2Fmultimedia%2Fmmsvc-player.git [0.2.65] Fix Coverity issues Change-Id: I4856744376644b893389ceb034af863edc6cc155 --- diff --git a/legacy/src/legacy_player.c b/legacy/src/legacy_player.c index fd9565a..36a4aa5 100644 --- a/legacy/src/legacy_player.c +++ b/legacy/src/legacy_player.c @@ -706,8 +706,11 @@ static int __msg_callback(int message, void *param, void *user_data) break; case MM_MESSAGE_SEEK_COMPLETED: /* 0x114 */ if (handle->display_type != PLAYER_DISPLAY_TYPE_NONE && handle->state == PLAYER_STATE_READY) { - if (handle->is_display_visible) - mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", 1, (char *)NULL); + if (handle->is_display_visible) { + int ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", 1, (char *)NULL); + if (ret != MM_ERROR_NONE) + LOGW("[%s] Failed to set display_visible '1' (0x%x)", __FUNCTION__, ret); + } } if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK]) { __ADD_MESSAGE(handle, PLAYER_MESSAGE_SEEK_DONE); @@ -1571,9 +1574,11 @@ int legacy_player_start(player_h player) player_s *handle = (player_s *)player; int ret; if (handle->state == PLAYER_STATE_READY || handle->state == PLAYER_STATE_PAUSED) { - if (handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY && handle->is_display_visible) + if (handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY && handle->is_display_visible) { ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", 1, (char *)NULL); - + if (ret != MM_ERROR_NONE) + LOGW("[%s] Failed to set display_visible '1' (0x%x)", __FUNCTION__, ret); + } if (handle->is_stopped) { if (handle->is_progressive_download) { LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)", __FUNCTION__, PLAYER_ERROR_INVALID_OPERATION); @@ -1613,9 +1618,8 @@ int legacy_player_stop(player_h player) if (handle->state == PLAYER_STATE_PLAYING || handle->state == PLAYER_STATE_PAUSED) { if (handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY) { ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", 0, (char *)NULL); - if (ret != MM_ERROR_NONE) { + if (ret != MM_ERROR_NONE) LOGW("[%s] Failed to set display_visible '0' (0x%x)", __FUNCTION__, ret); - } } ret = mm_player_stop(handle->mm_handle); diff --git a/muse/include/muse_player_msg.h b/muse/include/muse_player_msg.h index 8a87033..911db7b 100644 --- a/muse/include/muse_player_msg.h +++ b/muse/include/muse_player_msg.h @@ -257,7 +257,7 @@ typedef struct { #define player_send_msg_with_no_return(fd, msg) \ do { \ int __len__ = 0; \ - if (fd != MM_ERROR_INVALID_ARGUMENT) { \ + if ((fd != MM_ERROR_INVALID_ARGUMENT) && muse_core_fd_is_valid(fd)) { \ __len__ = muse_core_msg_send(fd, msg); \ if (__len__ <= 0) \ LOGE("sending message failed"); \ @@ -269,7 +269,7 @@ typedef struct { #define player_send_msg(fd, msg, ret) \ do { \ int __len__ = 0; \ - if (fd != MM_ERROR_INVALID_ARGUMENT) { \ + if ((fd != MM_ERROR_INVALID_ARGUMENT) && muse_core_fd_is_valid(fd)) { \ __len__ = muse_core_msg_send(fd, msg); \ if (__len__ <= 0) { \ LOGE("sending message failed"); \ @@ -284,7 +284,7 @@ typedef struct { #define player_send_msg_with_fd(fd, tfd, msg) \ do { \ int __len__ = 0; \ - if (fd != MM_ERROR_INVALID_ARGUMENT) { \ + if ((fd != MM_ERROR_INVALID_ARGUMENT) && muse_core_fd_is_valid(fd)) { \ __len__ = muse_core_msg_send_fd(fd, tfd, msg); \ if (__len__ <= 0) \ LOGE("sending message failed"); \ diff --git a/packaging/mmsvc-player.spec b/packaging/mmsvc-player.spec index 074dd8e..70c7b8e 100644 --- a/packaging/mmsvc-player.spec +++ b/packaging/mmsvc-player.spec @@ -1,6 +1,6 @@ Name: mmsvc-player Summary: A Media Player module for muse server -Version: 0.2.64 +Version: 0.2.65 Release: 0 Group: Multimedia/Libraries License: Apache-2.0