From 2f74d91d87b20d6f3e131b1afcedb646329ab1af Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 14 Apr 2016 18:47:50 +0200 Subject: [PATCH] windowscodecs: Allocate correct amount of memory for PNG image data. Signed-off-by: Dmitry Timoshkov Signed-off-by: Sebastian Lackner Signed-off-by: Vincent Povirk Signed-off-by: Alexandre Julliard --- 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 cd9165b5e36..3eb4d0ecbdd 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);