From 7eaff17786717f9816a40ee5417a57dd3264b331 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 15 Jul 2015 16:34:34 +0800 Subject: [PATCH] windowscodecs: Properly handle empty GIF extension blocks. --- dlls/windowscodecs/ungif.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/windowscodecs/ungif.c b/dlls/windowscodecs/ungif.c index b413ff05be2..c6711c8e24c 100644 --- a/dlls/windowscodecs/ungif.c +++ b/dlls/windowscodecs/ungif.c @@ -932,9 +932,17 @@ DGifSlurp(GifFileType * GifFile) { Extensions->Function = Function; - /* Create an extension block with our data */ - if (AddExtensionBlock(Extensions, ExtData[0], &ExtData[1]) == GIF_ERROR) - return (GIF_ERROR); + if (ExtData) + { + /* Create an extension block with our data */ + if (AddExtensionBlock(Extensions, ExtData[0], &ExtData[1]) == GIF_ERROR) + return (GIF_ERROR); + } + else /* Empty extension block */ + { + if (AddExtensionBlock(Extensions, 0, NULL) == GIF_ERROR) + return (GIF_ERROR); + } while (ExtData != NULL) { int Len; -- 2.11.4.GIT