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

@@ -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