From: Jiyong Min Date: Mon, 13 Dec 2021 04:17:50 +0000 (+0900) Subject: replace g_memdup() to g_memdup2() X-Git-Tag: accepted/tizen/unified/20211222.230459^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23b57d9195452a68f99482ce9d251f666b204da5;p=platform%2Fcore%2Fmultimedia%2Flibmm-utility.git replace g_memdup() to g_memdup2() - g_memdup() was removed in glib2 Change-Id: I6b2554e5e48d582c978d70dc097a60078fa52b6d --- diff --git a/common/mm_util_image.c b/common/mm_util_image.c index a09c4d5..cfd9f40 100755 --- a/common/mm_util_image.c +++ b/common/mm_util_image.c @@ -66,7 +66,7 @@ int mm_image_create_image(unsigned int width, unsigned int height, if (size == TEMP_DATA_SIZE) _image->data = (unsigned char *)data; else - _image->data = g_memdup(data, size); + _image->data = g_memdup2(data, size); _image->size = size; _image->width = width; @@ -98,7 +98,7 @@ int mm_image_clone_image(mm_util_image_h src, mm_util_image_h *dst) if (_src->size == TEMP_DATA_SIZE) _dst->data = _src->data; else - _dst->data = g_memdup(_src->data, _dst->size); + _dst->data = g_memdup2(_src->data, _dst->size); *dst = (mm_util_image_h)_dst; @@ -149,7 +149,7 @@ int mm_image_get_image(mm_util_image_h image, unsigned int *width, *color = _image->color; if (data && size) { - *data = g_memdup(_image->data, _image->size); + *data = g_memdup2(_image->data, _image->size); *size = _image->size; } diff --git a/gif/mm_util_gif.c b/gif/mm_util_gif.c index 5311c1b..f0e652e 100644 --- a/gif/mm_util_gif.c +++ b/gif/mm_util_gif.c @@ -111,7 +111,7 @@ static int __gif_generate_frame_buffer(GifFileType *gif_image, GifRowType **scre for (idx = 1; idx < (int)(gif_image->SHeight); idx++) { /* Allocate the other rows, and set their color to background too: */ - _screen_buf[idx] = g_memdup(_screen_buf[0], row_size); + _screen_buf[idx] = g_memdup2(_screen_buf[0], row_size); } *screen_buf = _screen_buf; @@ -478,7 +478,7 @@ static int __write_gif_to_buffer(gif_file_s *handle, void **buffer, size_t *buff mm_util_retvm_if(!handle->io_buf.buf || handle->io_buf.buf_size == 0, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid io_buf"); mm_util_retvm_if(!buffer || !buffer_size, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid buffer"); - *buffer = g_memdup(handle->io_buf.buf, handle->io_buf.buf_size);; + *buffer = g_memdup2(handle->io_buf.buf, handle->io_buf.buf_size); *buffer_size = handle->io_buf.buf_size; return MM_UTIL_ERROR_NONE; diff --git a/packaging/libmm-utility.spec b/packaging/libmm-utility.spec index 1094f73..bc167b2 100644 --- a/packaging/libmm-utility.spec +++ b/packaging/libmm-utility.spec @@ -1,6 +1,6 @@ Name: libmm-utility Summary: Multimedia Framework Utility Library -Version: 0.3.1 +Version: 0.3.2 Release: 0 Group: System/Libraries License: Apache-2.0 diff --git a/webp/mm_util_webp.c b/webp/mm_util_webp.c index fc27595..8822a2d 100644 --- a/webp/mm_util_webp.c +++ b/webp/mm_util_webp.c @@ -317,7 +317,7 @@ int mm_util_webp_anim_enc_save_to_buffer(mm_util_webp_anim_enc_h anim_enc_h, voi ret = __mm_util_webp_anim_enc_save(anim_enc, &webp_data); if (ret == MM_UTIL_ERROR_NONE) { - *buf = g_memdup(webp_data.bytes, webp_data.size); + *buf = g_memdup2(webp_data.bytes, webp_data.size); *buf_size = webp_data.size; } else { mm_util_error("Error! __mm_util_webp_anim_enc_save(%d)", ret);