From: hj kim Date: Thu, 16 Nov 2017 06:16:48 +0000 (+0900) Subject: change malloc to g_malloc0 X-Git-Tag: submit/tizen/20171120.082013~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e95c1d6cc881d0399ca761eccc96347e00b79b49;p=platform%2Fcore%2Fmultimedia%2Fdcm-service.git change malloc to g_malloc0 Change-Id: I8243bad63d0803db4fe597dee45f2d87230f1775 --- diff --git a/libdcm-util/dcm_image_codec.c b/libdcm-util/dcm_image_codec.c index 02ecae5..8e60a43 100755 --- a/libdcm-util/dcm_image_codec.c +++ b/libdcm-util/dcm_image_codec.c @@ -163,13 +163,12 @@ static int __dcm_rotate_rgb(unsigned char *source, const unsigned long long *siz return MS_MEDIA_ERR_INVALID_PARAMETER; } - temp_buf = (unsigned char*)malloc(_size); + temp_buf = (unsigned char*)g_malloc0(_size); if (temp_buf == NULL) { dcm_error("Failed to allocate memory"); return MS_MEDIA_ERR_OUT_OF_MEMORY; } - /* initialize */ - memset(temp_buf, 0x00, _size); + width = *ori_width; height = *ori_height; @@ -279,7 +278,7 @@ int dcm_decode_image(const char *file_path, const dcm_image_format_e format, } *size = buffer_size; - resize_buffer = (unsigned char *)malloc(sizeof(unsigned char) * (buffer_size)); + resize_buffer = (unsigned char *)g_malloc0(sizeof(unsigned char) * (buffer_size)); if (resize_buffer != NULL) { ret = image_util_resize(resize_buffer, (int *)buff_width, (int *)buff_height, decode_buffer, decode_width, decode_height, colorspace); DCM_SAFE_FREE(decode_buffer);