From 855d2b2c5a978f441a2f2f1343fb53b03b3568c9 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 27 Oct 2016 14:52:43 +0800
Subject: windowscodecs: Better follow the GIF spec and don't specify the local
 color table size if there is no local palette.

---
 dlls/windowscodecs/gifformat.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c
index 3dac59e..9d0ae6b 100644
--- a/dlls/windowscodecs/gifformat.c
+++ b/dlls/windowscodecs/gifformat.c
@@ -2070,9 +2070,11 @@ static HRESULT WINAPI GifFrameEncode_Commit(IWICBitmapFrameEncode *iface)
                 imd.height = This->height;
                 imd.packed = 0;
                 if (This->colors)
+                {
                     imd.packed |= 0x80; /* local color table flag */
+                    imd.packed |= 0x07; /* local color table size */
+                }
                 /* FIXME: interlace flag */
-                imd.packed |= 0x07; /* local color table size */
                 hr = IStream_Write(This->encoder->stream, &imd, sizeof(imd), NULL);
                 if (hr == S_OK && This->colors)
                 {
-- 
2.9.0

