Added patches to fix multiple minor issues in Wines windowscodecs implementation.

This commit is contained in:
Sebastian Lackner
2016-04-06 18:43:29 +02:00
parent 476a9c608e
commit 49ea937be3
3 changed files with 70 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
From 976652bfa10c79b935b7061243b1561d6dc0e605 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 6 Apr 2016 17:50:48 +0800
Subject: windowscodecs: Fix a copy/paste mistake.
---
dlls/windowscodecs/pngformat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index 4f5cb94..cd9165b 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -532,7 +532,7 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
}
This->end_info = ppng_create_info_struct(This->png_ptr);
- if (!This->info_ptr)
+ if (!This->end_info)
{
ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, NULL);
This->png_ptr = NULL;
--
2.7.1

View File

@@ -0,0 +1,26 @@
From 88fdb199c976ff130003f9582e1a2c3662c700ad Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 6 Apr 2016 11:52:08 +0800
Subject: windowscodecs: Allocate correct amount of memory for PNG image data.
Currently the memory being allocated 8 times exceeds the image size.
---
dlls/windowscodecs/pngformat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index cd9165b..3eb4d0e 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -664,7 +664,7 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
/* read the image data */
This->width = ppng_get_image_width(This->png_ptr, This->info_ptr);
This->height = ppng_get_image_height(This->png_ptr, This->info_ptr);
- This->stride = This->width * This->bpp;
+ This->stride = (This->width * This->bpp + 7) / 8;
image_size = This->stride * This->height;
This->image_bits = HeapAlloc(GetProcessHeap(), 0, image_size);
--
2.7.1