From: Jiyong Min Date: Tue, 7 Nov 2017 01:13:51 +0000 (+0900) Subject: Modify the size of the buffer for rotating or cropping image X-Git-Tag: submit/tizen/20171107.034519^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a43b67fc9c5e7e7532f929e42684994103b6542c;p=platform%2Fcore%2Fmultimedia%2Flibmm-utility.git Modify the size of the buffer for rotating or cropping image - Problem: Crash happen when image is rotated or cropped. - Cause & Solution: Because of removing the get resolution function at 'https://review.tizen.org/gerrit/#/c/158301/'. The size of 'dst' buffer is '0'. The size of buffer should be calculated by the width and height of source. Change-Id: I1d87e51648a70504c754f99cca2fd8ce6b378c6d Signed-off-by: Jiyong Min --- diff --git a/imgp/mm_util_imgp.c b/imgp/mm_util_imgp.c index 1e02879..2b960a0 100755 --- a/imgp/mm_util_imgp.c +++ b/imgp/mm_util_imgp.c @@ -1097,7 +1097,7 @@ static int __mm_util_processing(mm_util_s *handle) if (handle->set_convert) { dst_index++; - mm_util_get_image_size(handle->dst_format, handle->dst_width, handle->dst_height, &dst_buf_size); + mm_util_get_image_size(handle->dst_format, src_width, src_height, &dst_buf_size); dst_buf[dst_index] = g_malloc(dst_buf_size); if (dst_buf[dst_index] == NULL) { mm_util_error("[multi func] memory allocation error"); @@ -1121,15 +1121,15 @@ static int __mm_util_processing(mm_util_s *handle) switch (handle->dst_rotation) { case MM_UTIL_ROTATION_90: case MM_UTIL_ROTATION_270: - temp_swap = handle->dst_width; - handle->dst_width = handle->dst_height; - handle->dst_height = temp_swap; + temp_swap = src_width; + src_width = src_height; + src_height = temp_swap; break; default: break; } } - mm_util_get_image_size(src_format, handle->dst_width, handle->dst_height, &dst_buf_size); + mm_util_get_image_size(src_format, src_width, src_height, &dst_buf_size); dst_buf[dst_index] = g_malloc(dst_buf_size); if (dst_buf[dst_index] == NULL) { mm_util_error("[multi func] memory allocation error"); diff --git a/packaging/libmm-utility.spec b/packaging/libmm-utility.spec index 16d26c5..f0ac97a 100755 --- a/packaging/libmm-utility.spec +++ b/packaging/libmm-utility.spec @@ -1,6 +1,6 @@ Name: libmm-utility Summary: Multimedia Framework Utility Library -Version: 0.45 +Version: 0.46 Release: 0 Group: System/Libraries License: Apache-2.0