Dmitry Timoshkov : windowscodecs: Create global metadata blocks in the GIF decoder.

Alexandre Julliard julliard at winehq.org
Tue Sep 18 14:04:28 CDT 2012


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Tue Sep 18 12:57:19 2012 +0900

windowscodecs: Create global metadata blocks in the GIF decoder.

---

 dlls/windowscodecs/ungif.c |   15 +++++++++++++--
 dlls/windowscodecs/ungif.h |    1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/windowscodecs/ungif.c b/dlls/windowscodecs/ungif.c
index 97038d9..66310cb 100644
--- a/dlls/windowscodecs/ungif.c
+++ b/dlls/windowscodecs/ungif.c
@@ -884,13 +884,21 @@ DGifSlurp(GifFileType * GifFile) {
               break;
 
           case EXTENSION_RECORD_TYPE:
-              if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) ==
+          {
+              Extensions *Extensions;
+
+              if (GifFile->ImageCount)
+                  Extensions = &temp_save;
+              else
+                  Extensions = &GifFile->Extensions;
+
+              if (DGifGetExtension(GifFile, &Extensions->Function, &ExtData) ==
                   GIF_ERROR)
                   return (GIF_ERROR);
               while (ExtData != NULL) {
 
                   /* Create an extension block with our data */
-                  if (AddExtensionBlock(&temp_save, ExtData[0], &ExtData[1])
+                  if (AddExtensionBlock(Extensions, ExtData[0], &ExtData[1])
                       == GIF_ERROR)
                       return (GIF_ERROR);
 
@@ -899,6 +907,7 @@ DGifSlurp(GifFileType * GifFile) {
                   temp_save.Function = 0;
               }
               break;
+          }
 
           case TERMINATE_RECORD_TYPE:
               break;
@@ -1003,6 +1012,8 @@ DGifCloseFile(GifFileType * GifFile) {
         GifFile->SavedImages = NULL;
     }
 
+    FreeExtension(&GifFile->Extensions);
+
     ungif_free(GifFile);
 
     return GIF_OK;
diff --git a/dlls/windowscodecs/ungif.h b/dlls/windowscodecs/ungif.h
index 6c9f418..6caa600 100644
--- a/dlls/windowscodecs/ungif.h
+++ b/dlls/windowscodecs/ungif.h
@@ -117,6 +117,7 @@ typedef struct GifFileType {
       SBackGroundColor,         /* I hope you understand this one... */
       SAspectRatio;             /* Pixel aspect ratio, in 1/64 units, starting at 1:4. */
     ColorMapObject *SColorMap;  /* NULL if not exists. */
+    Extensions Extensions;
     int ImageCount;             /* Number of current image */
     GifImageDesc Image;         /* Block describing current image */
     struct SavedImage *SavedImages; /* Use this to accumulate file state */




More information about the wine-cvs mailing list