Added patch to fix init of LONGLONG variable with a negative value in TGA decoder.

This commit is contained in:
Sebastian Lackner
2015-01-15 18:18:50 +01:00
parent 603ba80d41
commit 3e7445275a
5 changed files with 48 additions and 1 deletions

View File

@@ -165,6 +165,7 @@ patch_enable_all ()
enable_user32_Mouse_Message_Hwnd="$1"
enable_user32_ScrollWindowEx="$1"
enable_user32_WndProc="$1"
enable_windowscodecs_TGA_Decoder="$1"
enable_wineboot_HKEY_DYN_DATA="$1"
enable_winebuild_LinkerVersion="$1"
enable_winecfg_Staging="$1"
@@ -522,6 +523,9 @@ patch_enable ()
user32-WndProc)
enable_user32_WndProc="$2"
;;
windowscodecs-TGA_Decoder)
enable_windowscodecs_TGA_Decoder="$2"
;;
wineboot-HKEY_DYN_DATA)
enable_wineboot_HKEY_DYN_DATA="$2"
;;
@@ -2807,6 +2811,18 @@ if test "$enable_user32_WndProc" -eq 1; then
) >> "$patchlist"
fi
# Patchset windowscodecs-TGA_Decoder
# |
# | Modified files:
# | * dlls/windowscodecs/tgaformat.c
# |
if test "$enable_windowscodecs_TGA_Decoder" -eq 1; then
patch_apply windowscodecs-TGA_Decoder/0001-windowscodecs-Fix-init-of-LONGLONG-variable-with-a-n.patch
(
echo '+ { "Christian Costa", "windowscodecs: Fix init of LONGLONG variable with a negative value in TGA decoder.", 1 },';
) >> "$patchlist"
fi
# Patchset wineboot-HKEY_DYN_DATA
# |
# | This patchset fixes the following Wine bugs:

View File

@@ -0,0 +1,28 @@
From be030703b8d36d47a7cfcad5268c983fa8fdf3ea Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Thu, 15 Jan 2015 09:57:18 +0100
Subject: windowscodecs: Fix init of LONGLONG variable with a negative value in
TGA decoder.
sizeof() is unsigned and thus -sizeof() too which leads to the signed bit not propagated when converted to LONGLONG.
This bug prevented the footage header to be found which contains the TGA spec 2.0 extension.
---
dlls/windowscodecs/tgaformat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/windowscodecs/tgaformat.c b/dlls/windowscodecs/tgaformat.c
index f2a867a..2b8cb1a 100644
--- a/dlls/windowscodecs/tgaformat.c
+++ b/dlls/windowscodecs/tgaformat.c
@@ -292,7 +292,7 @@ static HRESULT WINAPI TgaDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
This->image_offset = This->colormap_offset + This->colormap_length;
/* Read footer if there is one */
- seek.QuadPart = -sizeof(tga_footer);
+ seek.QuadPart = -(LONGLONG)sizeof(tga_footer);
hr = IStream_Seek(pIStream, seek, STREAM_SEEK_END, NULL);
if (SUCCEEDED(hr)) {
--
2.2.1

View File

@@ -0,0 +1 @@
Fixes: Fix init of LONGLONG variable with a negative value in TGA decoder