Commit 88faba8e authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Create global metadata blocks in the GIF decoder.

parent 629e7f44
...@@ -884,13 +884,21 @@ DGifSlurp(GifFileType * GifFile) { ...@@ -884,13 +884,21 @@ DGifSlurp(GifFileType * GifFile) {
break; break;
case EXTENSION_RECORD_TYPE: 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) GIF_ERROR)
return (GIF_ERROR); return (GIF_ERROR);
while (ExtData != NULL) { while (ExtData != NULL) {
/* Create an extension block with our data */ /* Create an extension block with our data */
if (AddExtensionBlock(&temp_save, ExtData[0], &ExtData[1]) if (AddExtensionBlock(Extensions, ExtData[0], &ExtData[1])
== GIF_ERROR) == GIF_ERROR)
return (GIF_ERROR); return (GIF_ERROR);
...@@ -899,6 +907,7 @@ DGifSlurp(GifFileType * GifFile) { ...@@ -899,6 +907,7 @@ DGifSlurp(GifFileType * GifFile) {
temp_save.Function = 0; temp_save.Function = 0;
} }
break; break;
}
case TERMINATE_RECORD_TYPE: case TERMINATE_RECORD_TYPE:
break; break;
...@@ -1003,6 +1012,8 @@ DGifCloseFile(GifFileType * GifFile) { ...@@ -1003,6 +1012,8 @@ DGifCloseFile(GifFileType * GifFile) {
GifFile->SavedImages = NULL; GifFile->SavedImages = NULL;
} }
FreeExtension(&GifFile->Extensions);
ungif_free(GifFile); ungif_free(GifFile);
return GIF_OK; return GIF_OK;
......
...@@ -117,6 +117,7 @@ typedef struct GifFileType { ...@@ -117,6 +117,7 @@ typedef struct GifFileType {
SBackGroundColor, /* I hope you understand this one... */ SBackGroundColor, /* I hope you understand this one... */
SAspectRatio; /* Pixel aspect ratio, in 1/64 units, starting at 1:4. */ SAspectRatio; /* Pixel aspect ratio, in 1/64 units, starting at 1:4. */
ColorMapObject *SColorMap; /* NULL if not exists. */ ColorMapObject *SColorMap; /* NULL if not exists. */
Extensions Extensions;
int ImageCount; /* Number of current image */ int ImageCount; /* Number of current image */
GifImageDesc Image; /* Block describing current image */ GifImageDesc Image; /* Block describing current image */
struct SavedImage *SavedImages; /* Use this to accumulate file state */ struct SavedImage *SavedImages; /* Use this to accumulate file state */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment