From: hj kim Date: Mon, 19 Feb 2018 23:59:52 +0000 (+0900) Subject: change dst_buf_size to res_buffer_size X-Git-Tag: submit/tizen/20180220.014003^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=115ddab1e7bc977ab9f5d9095abd56adfa7aa0fa;p=platform%2Fcore%2Fmultimedia%2Flibmm-utility.git change dst_buf_size to res_buffer_size Change-Id: I9e351f40cbd1aead859684111358e2649dd2474c --- diff --git a/imgp/mm_util_imgp.c b/imgp/mm_util_imgp.c index 7c97ebe..59847a7 100755 --- a/imgp/mm_util_imgp.c +++ b/imgp/mm_util_imgp.c @@ -571,7 +571,6 @@ static int __mm_util_processing(mm_util_s *handle) { int ret = MM_UTIL_ERROR_NONE; unsigned char *dst_buf[4] = {NULL,}; - unsigned int dst_buf_size = 0; unsigned int src_width = 0, src_height = 0; mm_util_color_format_e src_format = -1; unsigned int src_index = 0, dst_index = 0; @@ -610,8 +609,8 @@ static int __mm_util_processing(mm_util_s *handle) src_height = handle->dst_height; } else if (handle->set_resize) { dst_index++; - mm_util_get_image_size(src_format, handle->dst_width, handle->dst_height, &dst_buf_size); - dst_buf[dst_index] = calloc(1, dst_buf_size); + mm_util_get_image_size(src_format, handle->dst_width, handle->dst_height, &res_buffer_size); + dst_buf[dst_index] = calloc(1, res_buffer_size); if (dst_buf[dst_index] == NULL) { mm_util_error("[multi func] memory allocation error"); __mm_destroy_temp_buffer(dst_buf); @@ -630,8 +629,8 @@ static int __mm_util_processing(mm_util_s *handle) if (handle->set_convert) { dst_index++; - mm_util_get_image_size(handle->dst_format, src_width, src_height, &dst_buf_size); - dst_buf[dst_index] = calloc(1, dst_buf_size); + mm_util_get_image_size(handle->dst_format, src_width, src_height, &res_buffer_size); + dst_buf[dst_index] = calloc(1, res_buffer_size); if (dst_buf[dst_index] == NULL) { mm_util_error("[multi func] memory allocation error"); __mm_destroy_temp_buffer(dst_buf); @@ -652,13 +651,13 @@ static int __mm_util_processing(mm_util_s *handle) switch (handle->rotation) { case MM_UTIL_ROTATION_90: case MM_UTIL_ROTATION_270: - mm_util_get_image_size(src_format, src_height, src_width, &dst_buf_size); + mm_util_get_image_size(src_format, src_height, src_width, &res_buffer_size); break; default: - mm_util_get_image_size(src_format, src_width, src_height, &dst_buf_size); + mm_util_get_image_size(src_format, src_width, src_height, &res_buffer_size); break; } - dst_buf[dst_index] = calloc(1, dst_buf_size); + dst_buf[dst_index] = calloc(1, res_buffer_size); if (dst_buf[dst_index] == NULL) { mm_util_error("[multi func] memory allocation error"); __mm_destroy_temp_buffer(dst_buf); @@ -675,8 +674,8 @@ static int __mm_util_processing(mm_util_s *handle) src_height = handle->dst_height; } - if (dst_buf[dst_index] != NULL && dst_buf_size != 0) { - ret = mm_util_create_color_image((mm_util_color_image_h *)&(handle->dst), (unsigned long)src_width, (unsigned long)src_height, src_format, (void *)dst_buf[dst_index], (size_t)dst_buf_size); + if (dst_buf[dst_index] != NULL && res_buffer_size != 0) { + ret = mm_util_create_color_image((mm_util_color_image_h *)&(handle->dst), (unsigned long)src_width, (unsigned long)src_height, src_format, (void *)dst_buf[dst_index], (size_t)res_buffer_size); if (ret != MM_UTIL_ERROR_NONE) mm_util_error("mm_util_set_color_image failed"); }