summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;
}