From: Gilbok Lee Date: Tue, 13 Jun 2017 05:40:18 +0000 (+0900) Subject: Fix build warning for format string check X-Git-Tag: submit/tizen/20170615.061112~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F73%2F133673%2F1;p=platform%2Fcore%2Fapi%2Fvideo-util.git Fix build warning for format string check [Version] 0.1.10 [Profile] Mobile, TV [Issue Type] Fix bugs Change-Id: I694db89e9ffad451cf8176b192a3291b78acabc8 --- diff --git a/packaging/capi-media-video-util.spec b/packaging/capi-media-video-util.spec index 81859df..01a2d73 100755 --- a/packaging/capi-media-video-util.spec +++ b/packaging/capi-media-video-util.spec @@ -1,6 +1,6 @@ Name: capi-media-video-util Summary: A Video Utility library in Tizen Native API -Version: 0.1.9 +Version: 0.1.10 Release: 0 Group: System/Libraries License: Apache-2.0 diff --git a/src/video_util.c b/src/video_util.c index 6fe67c1..bb2fbbd 100755 --- a/src/video_util.c +++ b/src/video_util.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -382,6 +383,17 @@ int video_util_set_file_path(video_util_h handle, const char *file_path) video_util_secure_info("file_path [%s]\n", file_path); if (_handle->input_path != NULL) { + int exist = 0; + exist = open(file_path, O_RDONLY); + if (exist < 0) { + video_util_error("Fail to open original_path[%s]", file_path); + if (errno == EACCES || errno == EPERM) + return VIDEO_UTIL_ERROR_PERMISSION_DENIED; + else + return VIDEO_UTIL_ERROR_INVALID_PARAMETER; + } + close(exist); + ret = __video_util_check_transcode_is_busy(_handle, &is_busy); if (ret != VIDEO_UTIL_ERROR_NONE) return ret; @@ -628,7 +640,7 @@ int video_util_start_transcoding(video_util_h handle, unsigned long start, unsig } _handle = (video_util_s *)handle; - video_util_debug("start [%d] duration [%d]\n", start, duration); + video_util_debug("start [%lu] duration [%lu]\n", start, duration); if (_handle && (__video_util_check_duration(duration)) && (UTIL_STRING_VALID(_handle->input_path)) && (UTIL_STRING_VALID(out_path)) && completed_cb) { if (!_handle->transcode_h) { diff --git a/test/video_util_test.c b/test/video_util_test.c index c6b341c..97f7a73 100644 --- a/test/video_util_test.c +++ b/test/video_util_test.c @@ -89,10 +89,10 @@ bool test_transcode_spec_cb(int value, void *user_data) if (!strcmp(user_data, "format_check")) { switch (value) { case 0: - LOGI("[%s] --- [3gp]", user_data); + LOGI("[%s] --- [3gp]", (const char *)user_data); break; case 1: - LOGI("[%s] --- [mp4]", user_data); + LOGI("[%s] --- [mp4]", (const char *)user_data); break; default: break; @@ -100,13 +100,13 @@ bool test_transcode_spec_cb(int value, void *user_data) } else if (!strcmp(user_data, "video_codec_check")) { switch (value) { case 0: - LOGI("[%s] --- [m4v]", user_data); + LOGI("[%s] --- [m4v]", (const char *)user_data); break; case 1: - LOGI("[%s] --- [h263]", user_data); + LOGI("[%s] --- [h263]", (const char *)user_data); break; case 2: - LOGI("[%s] --- [h264]", user_data); + LOGI("[%s] --- [h264]", (const char *)user_data); break; default: break; @@ -114,10 +114,10 @@ bool test_transcode_spec_cb(int value, void *user_data) } else if (!strcmp(user_data, "audio_codec_check")) { switch (value) { case 0: - LOGI("[%s] --- [aac]", user_data); + LOGI("[%s] --- [aac]", (const char *)user_data); break; case 1: - LOGI("[%s] --- [amrnb]", user_data); + LOGI("[%s] --- [amrnb]", (const char *)user_data); break; default: break;