Dmitry Timoshkov : windowscodecs: Limit number of colors in a palette in BMP decoder.

Alexandre Julliard julliard at winehq.org
Tue Dec 4 16:33:56 CST 2018


Module: wine
Branch: master
Commit: 5a4f5ce8b4e2dd7a9597f8b94b2e58c0b37fd81f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5a4f5ce8b4e2dd7a9597f8b94b2e58c0b37fd81f

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Fri Nov 30 09:53:15 2018 +0300

windowscodecs: Limit number of colors in a palette in BMP decoder.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/windowscodecs/bmpdecode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/windowscodecs/bmpdecode.c b/dlls/windowscodecs/bmpdecode.c
index 6254b15..f5a2589 100644
--- a/dlls/windowscodecs/bmpdecode.c
+++ b/dlls/windowscodecs/bmpdecode.c
@@ -271,7 +271,7 @@ static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface,
             if (This->bih.bV5ClrUsed == 0)
                 count = 1 << This->bih.bV5BitCount;
             else
-                count = This->bih.bV5ClrUsed;
+                count = min(This->bih.bV5ClrUsed, 1 << This->bih.bV5BitCount);
 
             tablesize = sizeof(WICColor) * count;
             wiccolors = HeapAlloc(GetProcessHeap(), 0, tablesize);




More information about the wine-cvs mailing list