summaryrefslogtreecommitdiff
path: root/src/codec/img-codec.c
diff options
context:
space:
mode:
authorHaejeong Kim <backto.kim@samsung.com>2017-09-06 05:01:06 (GMT)
committerHaejeong Kim <backto.kim@samsung.com>2017-09-06 05:01:06 (GMT)
commitf621258d843be4b8ced15372dbfd088ecfa9949b (patch)
tree50e2490f26019740b5b0245b551bb8731195b9b5 /src/codec/img-codec.c
parent9bba570109967f1cc96acf53beef04ad34f2aaac (diff)
downloadlibmedia-thumbnail-f621258d843be4b8ced15372dbfd088ecfa9949b.zip
libmedia-thumbnail-f621258d843be4b8ced15372dbfd088ecfa9949b.tar.gz
libmedia-thumbnail-f621258d843be4b8ced15372dbfd088ecfa9949b.tar.bz2
Change-Id: Ia773b6de6f99a382a48221992b5d326dbec2e9cb
Diffstat (limited to 'src/codec/img-codec.c')
-rwxr-xr-xsrc/codec/img-codec.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/codec/img-codec.c b/src/codec/img-codec.c
index e87e93f..bebe05b 100755
--- a/src/codec/img-codec.c
+++ b/src/codec/img-codec.c
@@ -20,6 +20,7 @@
*/
#include "media-thumb-debug.h"
+#include "media-thumb-util.h"
#include "img-codec.h"
#include <string.h>
#include <image_util.h>
@@ -48,7 +49,7 @@ unsigned int *ImgGetFirstFrameAGIFAtSize(const char *szFileName,
if (ImgConvertRGB565ToRGB888(pFrameInfo->pOutBits, &pDecodedRGB888Buf, pFrameInfo->width, pFrameInfo->height)) {
if (pDecodedRGB888Buf) {
- free(pFrameInfo->pOutBits);
+ SAFE_FREE(pFrameInfo->pOutBits);
pFrameInfo->pOutBits = pDecodedRGB888Buf;
unsigned char *src = ((unsigned char *)(pFrameInfo->pOutBits));
@@ -172,11 +173,7 @@ AGifFrameInfo *ImgCreateAGIFFrame(const char *szFileName, unsigned int width, un
if (DrmReadFile(hFile, pEncodedData, mem_alloc_size, &size) == FALSE) {
thumb_err("DrmReadFile was failed");
DrmCloseFile(hFile);
-
- if (pEncodedData) {
- free(pEncodedData);
- pEncodedData = NULL;
- }
+ SAFE_FREE(pEncodedData);
return NULL;
}