summaryrefslogtreecommitdiff
path: root/src/media-thumb-internal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/media-thumb-internal.c')
-rwxr-xr-xsrc/media-thumb-internal.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c
index 9899783..3b3016e 100755
--- a/src/media-thumb-internal.c
+++ b/src/media-thumb-internal.c
@@ -32,10 +32,15 @@
#include <mm_file.h>
#include <mm_util_magick.h>
-static void __media_thumb_get_proper_thumb_size(int origin_width, int origin_height, int *thumb_width, int *thumb_height)
+static void __media_thumb_get_proper_thumb_size(unsigned int origin_width, unsigned int origin_height, unsigned int *thumb_width, unsigned int *thumb_height)
{
bool portrait = false;
- double ratio;
+ double ratio = 0.0;
+
+ thumb_retm_if(origin_width == 0, "Invalid origin_width");
+ thumb_retm_if(origin_height == 0, "Invalid origin_height");
+ thumb_retm_if(!thumb_width, "Invalid thumb_width");
+ thumb_retm_if(!thumb_height, "Invalid thumb_height");
if (origin_width < origin_height)
portrait = true;
@@ -88,7 +93,7 @@ int _media_thumb_general(const char *origin_path, const char *thumb_path, int th
return err;
}
-int _media_thumb_image(const char *origin_path, char *thumb_path, int thumb_width, int thumb_height, media_thumb_info *thumb_info)
+int _media_thumb_image(const char *origin_path, char *thumb_path, unsigned int thumb_width, unsigned int thumb_height, media_thumb_info *thumb_info)
{
int err = MS_MEDIA_ERR_NONE;
mm_util_img_codec_type image_type = 0;
@@ -257,7 +262,7 @@ static int __get_video_info(int cdis_value, const char *origin_path, int *video_
return MS_MEDIA_ERR_NONE;
}
-static int __get_video_thumb(int width, int height, void *frame, size_t size, mm_util_magick_rotate_type rot_type, const char *thumb_path, int thumb_width, int thumb_height, mm_util_image_h *dst_img)
+static int __get_video_thumb(int width, int height, void *frame, size_t size, mm_util_magick_rotate_type rot_type, const char *thumb_path, unsigned int thumb_width, unsigned int thumb_height, mm_util_image_h *dst_img)
{
int err = MS_MEDIA_ERR_NONE;
mm_util_image_h img = NULL;