Dmitry Timoshkov : windowscodecs: Fix calculation of transparent GIF color index.

Alexandre Julliard julliard at winehq.org
Mon Sep 24 16:04:24 CDT 2012


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Mon Sep 24 13:22:49 2012 +0900

windowscodecs: Fix calculation of transparent GIF color index.

---

 dlls/windowscodecs/gifformat.c       |    6 +++---
 dlls/windowscodecs/tests/gifformat.c |    1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c
index c378348..fc6909b 100644
--- a/dlls/windowscodecs/gifformat.c
+++ b/dlls/windowscodecs/gifformat.c
@@ -729,9 +729,9 @@ static HRESULT WINAPI GifFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface,
     /* look for the transparent color extension */
     for (i = 0; i < This->frame->Extensions.ExtensionBlockCount; ++i) {
 	eb = This->frame->Extensions.ExtensionBlocks + i;
-	if (eb->Function == 0xF9 && eb->ByteCount == 4) {
-	    if ((eb->Bytes[0] & 1) == 1) {
-	        trans = (unsigned char)eb->Bytes[3];
+	if (eb->Function == GRAPHICS_EXT_FUNC_CODE && eb->ByteCount == 8) {
+	    if (eb->Bytes[3] & 1) {
+	        trans = (unsigned char)eb->Bytes[6];
 	        colors[trans] &= 0xffffff; /* set alpha to 0 */
 	        break;
 	    }
diff --git a/dlls/windowscodecs/tests/gifformat.c b/dlls/windowscodecs/tests/gifformat.c
index 8788696..b9c1059 100644
--- a/dlls/windowscodecs/tests/gifformat.c
+++ b/dlls/windowscodecs/tests/gifformat.c
@@ -118,7 +118,6 @@ static void test_local_gif_palette(void)
     ok(hr == S_OK, "GetColors error %#x\n", hr);
     ok(ret == count, "expected %u, got %u\n", count, ret);
     ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]);
-todo_wine
     ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]);
     ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]);
     ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]);




More information about the wine-cvs mailing list