From: jiyong.min Date: Tue, 18 Aug 2020 04:30:54 +0000 (+0900) Subject: [UTC][capi-media-image-util][Non-ACR][Fix a problem where TC sometimes fails] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24cc87d1d2a69307041625bdec234f183cc59417;p=test%2Ftct%2Fnative%2Fapi.git [UTC][capi-media-image-util][Non-ACR][Fix a problem where TC sometimes fails] - Checked the other result value for encoding. g_encode_result[type].size -> g_encode_result[type].buffer_size - Add clear initialization for size and buffer_size. Change-Id: Ie4e57208f401ecde5852d28662eb8ad1c5aa19b7 --- diff --git a/src/utc/image-util/utc-image-util-decode-encode.c b/src/utc/image-util/utc-image-util-decode-encode.c index c4e740825..464a53a10 100755 --- a/src/utc/image-util/utc-image-util-decode-encode.c +++ b/src/utc/image-util/utc-image-util-decode-encode.c @@ -268,7 +268,10 @@ void utc_image_util_decode_cleanup(void) for (type = 0; type <= LAST_IMAGE_TYPE; type++) { IMAGEUTIL_SAFE_G_FREE(g_decode_result[type].buffer); + g_decode_result[type].size = 0; IMAGEUTIL_SAFE_G_FREE(g_encode_result[type].buffer); + g_encode_result[type].size = 0; + g_encode_result[type].buffer_size = 0; IMAGEUTIL_SAFE_G_FREE(g_source_path[type]); IMAGEUTIL_SAFE_G_FREE(g_output_path[type]); image_util_decode_destroy(g_decoder[type]); @@ -1644,7 +1647,10 @@ void utc_image_util_encode_cleanup(void) for (type = 0; type <= LAST_IMAGE_TYPE; type++) { IMAGEUTIL_SAFE_FREE(g_decode_result[type].buffer); + g_decode_result[type].size = 0; IMAGEUTIL_SAFE_FREE(g_encode_result[type].buffer); + g_encode_result[type].size = 0; + g_encode_result[type].buffer_size = 0; IMAGEUTIL_SAFE_G_FREE (g_source_path[type]); IMAGEUTIL_SAFE_G_FREE (g_output_path[type]); image_util_encode_destroy(g_encoder[type]); @@ -3145,7 +3151,7 @@ int utc_image_util_encode_run_async_to_buffer_p(void) wait_for_async(); assert_eq(callback_error, IMAGE_UTIL_ERROR_NONE); assert_neq(g_encode_result[type].buffer, NULL); - assert_gt(g_encode_result[type].size, 0); + assert_gt(g_encode_result[type].buffer_size, 0); } return 0;