[Bug 13274] :bitmap:X11DRV_DIB_GetColorCount called with >256 colors!

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Nov 18 10:43:56 CST 2008


http://bugs.winehq.org/show_bug.cgi?id=13274





--- Comment #8 from Austin English <austinenglish at gmail.com>  2008-11-18 10:43:55 ---
(In reply to comment #6)
> > 
> > I had instrumented this long ago, and determined that due to the function
> > failing and returning NULL, the program then immediately crashed derefing the
> > NULL (as in the program didn't expect that function to every fail).
> > 
> 
> Can you attach a +bitmap log?
> 

Try this patch:
diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c
index 7782c51..1f3a6f9 100644
--- a/dlls/gdi32/dib.c
+++ b/dlls/gdi32/dib.c
@@ -1208,7 +1208,8 @@ static void DIB_CopyColorTable( DC *dc, BITMAPOBJ *bmp,
WORD coloruse, const BIT

     if (colors > 256) {
         ERR("called with >256 colors!\n");
-        return;
+        colors = 0;
+        return colors;
     }

     if (!(colorTable = HeapAlloc(GetProcessHeap(), 0, colors * sizeof(RGBQUAD)
))) return;


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list