From 57c0156d68b7c2cb06d1ea185eef9aa2915a150e Mon Sep 17 00:00:00 2001 From: Ravi Kiran K N Date: Wed, 20 Sep 2017 15:54:26 +0530 Subject: [PATCH] Fix SVACE errors Change-Id: Id3ee81f92107affe7b79dc16a95e2e85072b8098 Signed-off-by: Ravi Kiran K N --- playview/src/view/vp-play-normal-view.c | 63 ++++++++++++++++++--------------- src/view/mp-video-list-share-via-view.c | 5 +++ video-downloader/src/VppDownload.c | 6 +++- 3 files changed, 45 insertions(+), 29 deletions(-) diff --git a/playview/src/view/vp-play-normal-view.c b/playview/src/view/vp-play-normal-view.c index f0d5741..0e949b6 100644 --- a/playview/src/view/vp-play-normal-view.c +++ b/playview/src/view/vp-play-normal-view.c @@ -1905,10 +1905,10 @@ static void __vp_normal_detail_popup_close_cb(int nType, bool bPause, if (!vp_mm_player_play(pNormalView->pPlayerHandle)) { VideoLogWarning("resume Fail"); } - if (pPlayView->win_minicon) { + if (pPlayView && pPlayView->win_minicon) { vp_minicontroller_update_control(pPlayView); } - if (pPlayView->win_lockmini) { + if (pPlayView && pPlayView->win_lockmini) { vp_lockscreenmini_update_control(pPlayView); } _vp_play_normal_view_set_play_state(pNormalView); @@ -1961,10 +1961,10 @@ static void __vp_normal_audio_track_popup_close_cb(int nType, bool bPause, if (!vp_mm_player_pause(pNormalView->pPlayerHandle)) { VideoLogWarning("Pause Fail"); } - if (pPlayView->win_minicon) { + if (pPlayView && pPlayView->win_minicon) { vp_minicontroller_update_control(pPlayView); } - if (pPlayView->win_lockmini) { + if (pPlayView && pPlayView->win_lockmini) { vp_lockscreenmini_update_control(pPlayView); } _vp_play_normal_view_set_play_state(pNormalView); @@ -2876,10 +2876,10 @@ static Evas_Event_Flags __vp_normal_gesture_double_click_end_cb(void } if (nState == VP_MM_PLAYER_STATE_PLAYING) { vp_mm_player_pause(pNormalView->pPlayerHandle); - if (pPlayView->win_minicon) { + if (pPlayView && pPlayView->win_minicon) { vp_minicontroller_update_control(pPlayView); } - if (pPlayView->win_lockmini) { + if (pPlayView && pPlayView->win_lockmini) { vp_lockscreenmini_update_control(pPlayView); } pNormalView->bManualPause = TRUE; @@ -3302,6 +3302,7 @@ static void __vp_normal_progress_mouse_down_cb(void *pUserData, Evas * e, PlayView *pPlayView = pNormalView->pPlayView; if (!pPlayView) { VideoLogError("pPlayView is NULL"); + return; } VideoLogWarning("Mouse Down"); @@ -4025,6 +4026,7 @@ static Eina_Bool __vp_normal_speed_timer_cb(void *pUserData) if (!pPlayView) { VideoLogError("pPlayView is NULL"); + return EINA_TRUE; } if (pNormalView->bSpeedDown) { @@ -6477,6 +6479,7 @@ static void __vp_normal_media_key_event_cb(vp_media_key_event_t nKey, if (!pPlayView) { VideoLogError("pPlayView is NULL"); + return; } if (pNormalView->bSharepopup) { VideoLogWarning("bSharepopup is TRUE"); @@ -8368,6 +8371,7 @@ static bool _vp_play_normal_view_play_start(NormalView * pNormalView, vp_play_util_get_sdp_url((const char *) pNormalView-> szMediaURL); if (vp_play_util_check_sdp_url((const char *) szSdpPath)) { + VP_FREE(szSdpPath); return TRUE; } VP_FREE(szSdpPath); @@ -8633,17 +8637,20 @@ static void _vp_play_normal_view_on_next_play(NormalView * pNormalView, VP_FREE(pNormalView->szMediaURL); VP_STRDUP(pNormalView->szMediaURL, szNextURL); VP_FREE(szNextURL); - _vp_play_normal_view_play_start(pNormalView, TRUE); - vp_mm_player_state_t nState = VP_MM_PLAYER_STATE_NONE; - if (!vp_mm_player_get_state - (pNormalView->pPlayerHandle, &nState)) { - VideoLogWarning("vp_mm_player_get_state is fail"); - } - if (!stay_pause && nState != VP_MM_PLAYER_STATE_PLAYING) { - vp_mm_player_play(pNormalView->pPlayerHandle); - pNormalView->bManualPause = FALSE; + + if (_vp_play_normal_view_play_start(pNormalView, TRUE)) { + vp_mm_player_state_t nState = VP_MM_PLAYER_STATE_NONE; + if (!vp_mm_player_get_state + (pNormalView->pPlayerHandle, &nState)) { + VideoLogWarning("vp_mm_player_get_state is fail"); + } + if (!stay_pause && nState != VP_MM_PLAYER_STATE_PLAYING) { + vp_mm_player_play(pNormalView->pPlayerHandle); + pNormalView->bManualPause = FALSE; + } } + if (stay_pause) { VideoLogDebug ("Some other application requested Video Player to remain in Paused state"); @@ -8810,16 +8817,18 @@ static void _vp_play_normal_view_on_prev_play(NormalView * pNormalView, } _vp_play_normal_view_on_bookmark_mode(pNormalView, FALSE); - _vp_play_normal_view_play_start(pNormalView, TRUE); - vp_mm_player_state_t nState = VP_MM_PLAYER_STATE_NONE; - if (!vp_mm_player_get_state(pNormalView->pPlayerHandle, &nState)) { - VideoLogWarning("vp_mm_player_get_state is fail"); - } - if (!stay_pause && nState != VP_MM_PLAYER_STATE_PLAYING) { - vp_mm_player_play(pNormalView->pPlayerHandle); - pNormalView->bManualPause = FALSE; + if (_vp_play_normal_view_play_start(pNormalView, TRUE)) { + vp_mm_player_state_t nState = VP_MM_PLAYER_STATE_NONE; + if (!vp_mm_player_get_state(pNormalView->pPlayerHandle, &nState)) { + VideoLogWarning("vp_mm_player_get_state is fail"); + } + if (!stay_pause && nState != VP_MM_PLAYER_STATE_PLAYING) { + vp_mm_player_play(pNormalView->pPlayerHandle); + pNormalView->bManualPause = FALSE; + } } + if (stay_pause) { VideoLogDebug ("Some other application requested Video Player to remain in Paused state"); @@ -13199,8 +13208,7 @@ static void _vp_play_normal_view_prepare_pipe_cb(void *data, void vp_check_is_live_streming(NormalView *pNormalView, PlayView * pPlayView, char *path) { /* Supported streaming protocols */ - char streamingProtocols[VP_NORMAL_STREAMING_PROTOCOLS_MAX][VP_NORMAL_MAX_STR_LEN] = - { + char streamingProtocols[VP_NORMAL_STREAMING_PROTOCOLS_MAX][VP_NORMAL_MAX_STR_LEN] = { "http://", "rtsp://" }; @@ -13210,9 +13218,8 @@ void vp_check_is_live_streming(NormalView *pNormalView, PlayView * pPlayView, ch pNormalView->isLiveStreaming = false; pPlayView->isLiveStreaming = false; - for(ctr = 0; ctr < VP_NORMAL_STREAMING_PROTOCOLS_MAX; ctr++) - { - if(!strncmp(streamingProtocols[ctr], path, strlen(streamingProtocols[ctr]))) { + for (ctr = 0; ctr < VP_NORMAL_STREAMING_PROTOCOLS_MAX; ctr++) { + if (!strncmp(streamingProtocols[ctr], path, strlen(streamingProtocols[ctr]))) { pNormalView->isLiveStreaming = true; pPlayView->isLiveStreaming = true; break; diff --git a/src/view/mp-video-list-share-via-view.c b/src/view/mp-video-list-share-via-view.c index f058d90..ba88771 100644 --- a/src/view/mp-video-list-share-via-view.c +++ b/src/view/mp-video-list-share-via-view.c @@ -1706,6 +1706,11 @@ static bool __mp_share_view_get_selected_video_list(int nSelectedSize) g_pShareViaHandle->pSelectedList = (char **) calloc(sizeof(char *), nSelectedSize); + if (g_pShareViaHandle->pSelectedList) { + VideoLogError("pSelectedList is NULL"); + return FALSE; + } + VideoLogInfo("current edit size===%d", nSelectedSize); for (nCounter = 0; nCounter < nVideoListSize; nCounter++) { diff --git a/video-downloader/src/VppDownload.c b/video-downloader/src/VppDownload.c index c12f1b5..b4b8395 100644 --- a/video-downloader/src/VppDownload.c +++ b/video-downloader/src/VppDownload.c @@ -982,7 +982,7 @@ bool __VppDownloadCreate(__VppDownloadItem * pItem) } else { int dstlength = strlen(pItem->pDstName); if (dstlength + 1 <= PATH_MAX) { - strncpy(szDestName, pItem->pDstName, dstlength); + strncpy(szDestName, pItem->pDstName, dstlength + 1); } } @@ -1187,6 +1187,10 @@ bool __VppDownloadListAdd(__VppDownloadItem * pItem, bool bAppend) __VppDownloadListInitialize(); } + if (g_download_list == NULL) { + return FALSE; + } + if (bAppend == TRUE) { g_download_list->downloadList = eina_list_append(g_download_list->downloadList, -- 2.7.4