Fix coverity issue 57/173057/2 accepted/tizen/unified/20180321.060749 submit/tizen/20180320.040253
authorhj kim <backto.kim@samsung.com>
Mon, 19 Mar 2018 09:29:26 +0000 (18:29 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Tue, 20 Mar 2018 07:53:20 +0000 (16:53 +0900)
Change-Id: Idd08754b958fd8b334c0d4564102c86c6322c745

imgp/mm_util_imgp.c

index a9fa6e5..6f8088a 100755 (executable)
@@ -611,6 +611,9 @@ static int __mm_util_processing(mm_util_s *handle)
                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], res_buffer_size);
                if (ret != MM_UTIL_ERROR_NONE)
                        mm_util_error("mm_util_set_color_image failed");
+       } else {
+               mm_util_error("invalid result %p %zu", dst_buf[dst_index], res_buffer_size);
+               ret = MM_UTIL_ERROR_INVALID_OPERATION;
        }
        __mm_destroy_temp_buffer(dst_buf);
 
@@ -633,10 +636,7 @@ static int __mm_util_transform_exec(mm_util_s *handle, color_image_data_s *sourc
        handle->dst = NULL;
 
        ret = __mm_util_processing(handle);
-       if (ret != MM_UTIL_ERROR_NONE) {
-               mm_util_error("__mm_util_processing failed (%d)", ret);
-               return ret;
-       }
+       mm_util_retvm_if(ret != MM_UTIL_ERROR_NONE, ret, "__mm_util_processing failed [%d]", ret);
 
        mm_util_debug("result_image: %p [%zu] %lu X %lu (%u)", handle->dst->data, handle->dst->size,
                handle->dst->width, handle->dst->height, handle->dst->color);