Modify the range of 'imgsize' from 'unsigned int' to 'Size_t' 26/170426/2 submit/tizen/20180220.054545
authorJiyong Min <jiyong.min@samsung.com>
Tue, 20 Feb 2018 05:05:23 +0000 (14:05 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Tue, 20 Feb 2018 05:09:20 +0000 (14:09 +0900)
(fix 64bit error)

Change-Id: I440601c12e34cfae2ca8cf75580bb5990bd24d86
Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
imgp/include/mm_util_imgp.h
imgp/mm_util_imgp.c
jpeg/mm_util_jpeg.c

index 1f48d85b6273985ff3ed8ccabe01b46d3b62b2f0..bb139ee3c68159b83ca6350fb355f430f1528a21 100755 (executable)
@@ -67,7 +67,7 @@ typedef enum {
  * @see         mm_util_color_format_e
  * @since       R1, 1.0
  */
-int mm_util_get_image_size(mm_util_color_format_e format, unsigned int width, unsigned int height, unsigned int *size);
+int mm_util_get_image_size(mm_util_color_format_e format, unsigned int width, unsigned int height, size_t *imgsize);
 
 /**
  *
index 59847a7c16ab6eaf0621b3d45bce040a0787562a..7867343132fd09db9c092e6dff9945fcf07b9f3a 100755 (executable)
@@ -1305,7 +1305,7 @@ unsigned int crop_start_x, unsigned int crop_start_y, unsigned int crop_dest_wid
        return ret;
 }
 
-int mm_util_get_image_size(mm_util_color_format_e format, unsigned int width, unsigned int height, unsigned int *imgsize)
+int mm_util_get_image_size(mm_util_color_format_e format, unsigned int width, unsigned int height, size_t *imgsize)
 {
        int ret = MM_UTIL_ERROR_NONE;
        unsigned char x_chroma_shift = 0;
index 4f4cf2ba5e6428ec204be6736b131109c6d2c987..a31a41b861c2148e1038bf5ad648ca6048330535 100755 (executable)
@@ -1240,7 +1240,7 @@ int mm_util_jpeg_encode_to_file(const char *filename, void* src, int width, int
 #else
        mm_util_debug("#START# LIBJPEG");
        if (fmt == MM_UTIL_COLOR_NV12) {
-               unsigned int dst_size = 0;
+               size_t dst_size = 0;
                ret = mm_util_get_image_size(MM_UTIL_COLOR_NV12, (unsigned int)width, (unsigned int)height, &dst_size);
                unsigned char *dst = NULL;
                dst = calloc(1, dst_size);
@@ -1295,7 +1295,7 @@ int mm_util_jpeg_encode_to_memory(void **mem, unsigned int *size, void* src, int
 #else /* LIBJPEG_TURBO */
        mm_util_debug("#START# libjpeg");
        if (fmt == MM_UTIL_COLOR_NV12) {
-               unsigned int dst_size = 0;
+               size_t dst_size = 0;
                ret = mm_util_get_image_size(MM_UTIL_COLOR_NV12, (unsigned int)width, (unsigned int)height, &dst_size);
                unsigned char *dst = NULL;
                dst = calloc(1, dst_size);
@@ -1362,7 +1362,7 @@ int mm_util_decode_from_jpeg_file(mm_util_jpeg_yuv_data *decoded, const char *fi
 #else
                mm_util_debug("#START# libjpeg(fmt:%d)", fmt);
                if (fmt == MM_UTIL_COLOR_NV12) {
-                       unsigned int dst_size = 0;
+                       size_t dst_size = 0;
                        ret = __mm_image_decode_from_jpeg_file_with_libjpeg(decoded, filename, MM_UTIL_COLOR_YUV420, MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1);
                        if (ret == MM_UTIL_ERROR_NONE) {
                                int err = MM_UTIL_ERROR_NONE;
@@ -1382,7 +1382,7 @@ int mm_util_decode_from_jpeg_file(mm_util_jpeg_yuv_data *decoded, const char *fi
                                                return MM_UTIL_ERROR_OUT_OF_MEMORY;
                                        }
                                        memcpy(decoded->data, dst, dst_size);
-                                       decoded->size = dst_size;
+                                       decoded->size = (unsigned int)dst_size;
                                        MMUTIL_SAFE_FREE(dst);
                                } else {
                                        mm_util_debug("memory allocation failed");
@@ -1436,7 +1436,7 @@ int mm_util_decode_from_jpeg_memory(mm_util_jpeg_yuv_data *decoded, void *src, u
 #else
        mm_util_debug("#START# libjpeg");
        if (fmt == MM_UTIL_COLOR_NV12) {
-               unsigned int dst_size = 0;
+               size_t dst_size = 0;
                unsigned char *dst = NULL;
 
                ret = __mm_image_decode_from_jpeg_memory_with_libjpeg(decoded, src, size, MM_UTIL_COLOR_YUV420, MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1);
@@ -1457,7 +1457,7 @@ int mm_util_decode_from_jpeg_memory(mm_util_jpeg_yuv_data *decoded, void *src, u
                                        return MM_UTIL_ERROR_OUT_OF_MEMORY;
                                }
                                memcpy(decoded->data, dst, dst_size);
-                               decoded->size = dst_size;
+                               decoded->size = (unsigned int)dst_size;
                                MMUTIL_SAFE_FREE(dst);
                        } else {
                                mm_util_debug("memory allocation failed");
@@ -1544,7 +1544,7 @@ int mm_util_decode_from_jpeg_file_with_downscale(mm_util_jpeg_yuv_data *decoded,
                                                return MM_UTIL_ERROR_OUT_OF_MEMORY;
                                        }
                                        memcpy(decoded->data, dst, dst_size);
-                                       decoded->size = dst_size;
+                                       decoded->size = (unsigned int)dst_size;
                                        MMUTIL_SAFE_FREE(dst);
                                } else {
                                        mm_util_debug("memory allocation failed");
@@ -1604,7 +1604,7 @@ int mm_util_decode_from_jpeg_memory_with_downscale(mm_util_jpeg_yuv_data *decode
 #else
        mm_util_debug("#START# libjpeg");
        if (fmt == MM_UTIL_COLOR_NV12) {
-               unsigned int dst_size = 0;
+               size_t dst_size = 0;
                unsigned char *dst = NULL;
 
                ret = __mm_image_decode_from_jpeg_memory_with_libjpeg(decoded, src, size, MM_UTIL_COLOR_YUV420, downscale);
@@ -1625,7 +1625,7 @@ int mm_util_decode_from_jpeg_memory_with_downscale(mm_util_jpeg_yuv_data *decode
                                        return MM_UTIL_ERROR_OUT_OF_MEMORY;
                                }
                                memcpy(decoded->data, dst, dst_size);
-                               decoded->size = dst_size;
+                               decoded->size = (unsigned int)dst_size;
                                MMUTIL_SAFE_FREE(dst);
                        } else {
                                mm_util_debug("memory allocation failed");