windowscodecs: Fix leak in DGifGetImageDesc.

Vincent Povirk madewokherd at gmail.com
Tue Jun 17 16:07:38 CDT 2014


For bug 36595.
-------------- next part --------------
From fb5f17d76349512bba10e5228d90254b50f4114f Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Thu, 12 Jun 2014 14:15:21 -0500
Subject: [PATCH] windowscodecs: Fix leak in DGifGetImageDesc.

We never reuse the Image.ColorMap pointers, and it's not possible for the
caller to capture them before they're overwritten.
---
 dlls/windowscodecs/ungif.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/dlls/windowscodecs/ungif.c b/dlls/windowscodecs/ungif.c
index c2887ed..427b32f 100644
--- a/dlls/windowscodecs/ungif.c
+++ b/dlls/windowscodecs/ungif.c
@@ -405,10 +405,7 @@ DGifGetImageDesc(GifFileType * GifFile) {
     GifFile->Image.Interlace = (Buf[0] & 0x40);
     if (Buf[0] & 0x80) {    /* Does this image have local color map? */
 
-        /*** FIXME: Why do we check both of these in order to do this?
-         * Why do we have both Image and SavedImages? */
-        if (GifFile->Image.ColorMap && GifFile->SavedImages == NULL)
-            FreeMapObject(GifFile->Image.ColorMap);
+        FreeMapObject(GifFile->Image.ColorMap);
 
         GifFile->Image.ColorMap = MakeMapObject(1 << BitsPerPixel, NULL);
         if (GifFile->Image.ColorMap == NULL) {
-- 
1.8.3.2



More information about the wine-patches mailing list