{
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;
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);
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);
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);
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");
}