Dmitry Timoshkov : windowscodecs: Properly handle empty GIF extension blocks.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 15 09:51:24 CDT 2015


Module: wine
Branch: master
Commit: 7eaff17786717f9816a40ee5417a57dd3264b331
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7eaff17786717f9816a40ee5417a57dd3264b331

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Wed Jul 15 16:34:34 2015 +0800

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 b413ff0..c6711c8 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;




More information about the wine-cvs mailing list