summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhj kim <backto.kim@samsung.com>2019-09-16 15:03:05 +0900
committerhj kim <backto.kim@samsung.com>2019-09-16 15:27:12 +0900
commit6c639dd723f86f3926e1fc24497017ec9020eae6 (patch)
treeaf9d3b8e1225f87fc231fd64a3e0e5bd293987e9
parent07eabeafa1053420d6b6d24b6df04a6bb9114c5d (diff)
downloadlibmedia-service-6c639dd723f86f3926e1fc24497017ec9020eae6.tar.gz
libmedia-service-6c639dd723f86f3926e1fc24497017ec9020eae6.tar.bz2
libmedia-service-6c639dd723f86f3926e1fc24497017ec9020eae6.zip
Fix Coverity issues
Change-Id: I29e746aaac9510defc329782c6c8e1751ed3ddb8
-rwxr-xr-xsrc/common/media-svc-util.c11
-rwxr-xr-xsrc/common/media-svc.c4
2 files changed, 11 insertions, 4 deletions
diff --git a/src/common/media-svc-util.c b/src/common/media-svc-util.c
index 780e156..f844947 100755
--- a/src/common/media-svc-util.c
+++ b/src/common/media-svc-util.c
@@ -1660,10 +1660,15 @@ void _media_svc_destroy_content_info(media_svc_content_info_s *content_info)
return;
}
-int __media_svc_get_proper_thumb_size(unsigned int orig_w, unsigned int orig_h, unsigned int *thumb_w, unsigned int *thumb_h)
+static void __media_svc_get_proper_thumb_size(unsigned int orig_w, unsigned int orig_h, unsigned int *thumb_w, unsigned int *thumb_h)
{
bool portrait = false;
- double ratio;
+ double ratio = 0.0;
+
+ media_svc_retm_if(orig_w <= 0, "Invalid orig_w");
+ media_svc_retm_if(orig_h <= 0, "Invalid orig_h");
+ media_svc_retm_if(!thumb_w, "Invalid thumb_w");
+ media_svc_retm_if(!thumb_h, "Invalid thumb_h");
if (orig_w < orig_h)
portrait = true;
@@ -1683,7 +1688,7 @@ int __media_svc_get_proper_thumb_size(unsigned int orig_w, unsigned int orig_h,
media_svc_debug("proper thumb w: %d h: %d", *thumb_w, *thumb_h);
- return MS_MEDIA_ERR_NONE;
+ return;
}
static void __get_rotation_and_cdis(const char *origin_path, mm_util_magick_rotate_type *rot_type, int *cdis_value)
diff --git a/src/common/media-svc.c b/src/common/media-svc.c
index cce795b..3e15520 100755
--- a/src/common/media-svc.c
+++ b/src/common/media-svc.c
@@ -675,7 +675,9 @@ static void __media_svc_noti_all_storage(sqlite3 *handle, uid_t uid)
GPtrArray *path_list = NULL;
int i = 0;
- ms_user_get_internal_root_path(uid, &root_path);
+ ret = ms_user_get_internal_root_path(uid, &root_path);
+ media_svc_retm_if(ret != MS_MEDIA_ERR_NONE, "Fail to get root path");
+
ret = _media_svc_publish_dir_noti(MS_MEDIA_ITEM_UPDATE, root_path, NULL, 0);
if (ret != MS_MEDIA_ERR_NONE)
media_svc_error("Fail to send noti");