Module: wine Branch: master Commit: 2f74d91d87b20d6f3e131b1afcedb646329ab1af URL: http://source.winehq.org/git/wine.git/?a=commit;h=2f74d91d87b20d6f3e131b1afc...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Thu Apr 14 18:47:50 2016 +0200
windowscodecs: Allocate correct amount of memory for PNG image data.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru Signed-off-by: Sebastian Lackner sebastian@fds-team.de Signed-off-by: Vincent Povirk vincent@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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);