diff options
Diffstat (limited to 'src/codec')
-rwxr-xr-x | src/codec/IfegDecodeAGIF.c | 2 | ||||
-rwxr-xr-x | src/codec/img-codec.c | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/codec/IfegDecodeAGIF.c b/src/codec/IfegDecodeAGIF.c index db69692..b6a08f2 100755 --- a/src/codec/IfegDecodeAGIF.c +++ b/src/codec/IfegDecodeAGIF.c @@ -111,8 +111,6 @@ AGifFrameInfo *FastImgCreateAGIFFrameData(unsigned int width, unsigned int heigh if (transparent == 1 && backcolor_index == transIndex) { image_backcolor = ui_backcolor; - } else if (transparent == 1 && backcolor_index != transIndex) { - image_backcolor = backcolor_parsing; } else { image_backcolor = backcolor_parsing; } diff --git a/src/codec/img-codec.c b/src/codec/img-codec.c index 1887e47..e37ab8b 100755 --- a/src/codec/img-codec.c +++ b/src/codec/img-codec.c @@ -151,8 +151,8 @@ AGifFrameInfo *ImgCreateAGIFFrame(const char *szFileName, unsigned int width, un DrmGetFileAttributes(szFileName, &fileAttrib); - if (fileAttrib.fileSize == 0) { - thumb_err("Zero File Size"); + if (fileAttrib.fileSize <= 0) { + thumb_err("Zero or below Zero File Size"); DrmCloseFile(hFile); return NULL; } @@ -161,7 +161,8 @@ AGifFrameInfo *ImgCreateAGIFFrame(const char *szFileName, unsigned int width, un /* A size of allocated memory - w * h *2 means RGB565 and 4096 means the max of header length */ // mem_alloc_size = width * height * 2 + MAX_GIF_HEADER_SIZE; mem_alloc_size = cFileSize; - if ((pEncodedData = (unsigned char *)malloc(mem_alloc_size)) == NULL) { + pEncodedData = (unsigned char *)malloc(mem_alloc_size); + if (pEncodedData == NULL) { thumb_err("Memory Allocation to pEncodedData failed"); DrmCloseFile(hFile); return NULL; |