summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoey Pan <joey.pan@mediatek.com>2014-06-12 09:08:26 +0800
committerTodd Poynor <toddpoynor@google.com>2014-06-30 23:28:07 +0000
commitb5a8e44648685070f146ff8456d36013c502f7a1 (patch)
treeb32569e6430a2e093c824da2e2232eb643217341
parent63317bdfd17684345b041e689b332abdd87d48e1 (diff)
downloadandroid_external_giflib-b5a8e44648685070f146ff8456d36013c502f7a1.tar.gz
android_external_giflib-b5a8e44648685070f146ff8456d36013c502f7a1.tar.bz2
android_external_giflib-b5a8e44648685070f146ff8456d36013c502f7a1.zip
handle no content comment block in the gif.staging/cm-12.0-cafstaging/cm-12.0
Change-Id: I3c87a151b0d0f487865c4f84d26101797bc91290 Signed-off-by: Joey Pan <joey.pan@mediatek.com> (cherry picked from commit 7ee131f83daab0744dbbfbbf2f375c05a5285f2e)
-rw-r--r--dgif_lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dgif_lib.c b/dgif_lib.c
index c7ff504..744a2f9 100644
--- a/dgif_lib.c
+++ b/dgif_lib.c
@@ -1134,11 +1134,13 @@ DGifSlurp(GifFileType *GifFile)
if (DGifGetExtension(GifFile,&ExtFunction,&ExtData) == GIF_ERROR)
return (GIF_ERROR);
/* Create an extension block with our data */
- if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount,
+ if (ExtData != NULL) {
+ if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount,
&GifFile->ExtensionBlocks,
ExtFunction, ExtData[0], &ExtData[1])
== GIF_ERROR)
return (GIF_ERROR);
+ }
while (ExtData != NULL) {
if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR)
return (GIF_ERROR);