summaryrefslogtreecommitdiff
path: root/src/codec
diff options
context:
space:
mode:
Diffstat (limited to 'src/codec')
-rwxr-xr-xsrc/codec/img-codec-parser.c5
-rwxr-xr-xsrc/codec/img-codec.c9
2 files changed, 3 insertions, 11 deletions
diff --git a/src/codec/img-codec-parser.c b/src/codec/img-codec-parser.c
index 70f9587..75f0a06 100755
--- a/src/codec/img-codec-parser.c
+++ b/src/codec/img-codec-parser.c
@@ -23,11 +23,6 @@
#include <stdlib.h>
#include <string.h>
-#if defined(_PERFORMANCE_CHECK_)
-#include <time.h>
-#include <sys/time.h>
-#endif
-
#include <media-util-err.h>
#include "media-thumb-debug.h"
#include "img-codec-common.h"
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;
}