Bug fix: Modify missing typecast 12/284612/1 accepted/tizen/unified/20221128.014947
authorjiyong.min <jiyong.min@samsung.com>
Tue, 15 Nov 2022 01:54:10 +0000 (10:54 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Tue, 22 Nov 2022 01:05:13 +0000 (10:05 +0900)
Change-Id: I54e91cfab2131bf9e6ead3369cfb340a25879361

imgp/mm_util_imgp.c

index 1dbcb1a..b8ab524 100644 (file)
@@ -95,6 +95,7 @@ static int __mm_util_get_image_size(mm_util_color_format_e format, unsigned int
        size_t w2, h2, stride, stride2;
        size_t size, size2;
        size_t _width = (size_t)width;
+       size_t _height = (size_t)height;
 
        mm_util_fenter();
 
@@ -108,11 +109,11 @@ static int __mm_util_get_image_size(mm_util_color_format_e format, unsigned int
                x_chroma_shift = 1;
                y_chroma_shift = 1;
                stride = MM_UTIL_ROUND_UP_4(_width);
-               h2 = ROUND_UP_X(height, x_chroma_shift);
+               h2 = ROUND_UP_X(_height, x_chroma_shift);
                size = stride * h2;
                w2 = DIV_ROUND_UP_X(_width, x_chroma_shift);
                stride2 = MM_UTIL_ROUND_UP_4(w2);
-               h2 = DIV_ROUND_UP_X(height, y_chroma_shift);
+               h2 = DIV_ROUND_UP_X(_height, y_chroma_shift);
                size2 = stride2 * h2;
                *imgsize = size + 2 * size2;
                break;
@@ -122,19 +123,19 @@ static int __mm_util_get_image_size(mm_util_color_format_e format, unsigned int
        case MM_UTIL_COLOR_NV16:
        case MM_UTIL_COLOR_NV61:
                stride = MM_UTIL_ROUND_UP_4(_width) * 2;
-               size = stride * height;
+               size = stride * _height;
                *imgsize = size;
                break;
 
        case MM_UTIL_COLOR_RGB16:
                stride = 2 * (is_crop ? _width : MM_UTIL_ROUND_UP_4(_width));
-               size = stride * height;
+               size = stride * _height;
                *imgsize = size;
                break;
 
        case MM_UTIL_COLOR_RGB24:
                stride = 3 * (is_crop ? _width : MM_UTIL_ROUND_UP_4(_width));
-               size = stride * height;
+               size = stride * _height;
                *imgsize = size;
                break;
 
@@ -143,7 +144,7 @@ static int __mm_util_get_image_size(mm_util_color_format_e format, unsigned int
        case MM_UTIL_COLOR_RGBA:
        case MM_UTIL_COLOR_BGRX:
                stride = _width * 4;
-               size = stride * height;
+               size = stride * _height;
                *imgsize = size;
                break;
 
@@ -153,11 +154,11 @@ static int __mm_util_get_image_size(mm_util_color_format_e format, unsigned int
                x_chroma_shift = 1;
                y_chroma_shift = 1;
                stride = MM_UTIL_ROUND_UP_4(_width);
-               h2 = ROUND_UP_X(height, y_chroma_shift);
+               h2 = ROUND_UP_X(_height, y_chroma_shift);
                size = stride * h2;
                w2 = 2 * DIV_ROUND_UP_X(_width, x_chroma_shift);
                stride2 = MM_UTIL_ROUND_UP_4(w2);
-               h2 = DIV_ROUND_UP_X(height, y_chroma_shift);
+               h2 = DIV_ROUND_UP_X(_height, y_chroma_shift);
                size2 = stride2 * h2;
                *imgsize = size + size2;
                break;