Rebase against 0b3e7115de6749262296518d659247168a202f5f

This commit is contained in:
Alistair Leslie-Hughes
2019-01-17 08:07:29 +11:00
parent 17083b95bb
commit 3161e5be34
2 changed files with 2 additions and 34 deletions

View File

@@ -1,30 +0,0 @@
From f11c062d6145e808e9eabdfb987e51e144157ab7 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 20 Oct 2016 19:05:02 +0800
Subject: [PATCH] windowscodecs: Fix the buffer size check in the TIFF
decoder's IWICBitmapFrameDecode::CopyPixels implementation.
Otherwise IWICBitmapSource::CopyPixels() after IWICImagingFactory::CreateBitmapFromSource()
fails for an 24bpp RGB/BGR source.
The check is copied from BMP decoder implementation.
---
dlls/windowscodecs/tiffformat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c
index 3d53b2439a3..255c780c9b1 100644
--- a/dlls/windowscodecs/tiffformat.c
+++ b/dlls/windowscodecs/tiffformat.c
@@ -1105,7 +1105,7 @@ static HRESULT WINAPI TiffFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface,
if (cbStride < bytesperrow)
return E_INVALIDARG;
- if ((cbStride * (prc->Height-1)) + bytesperrow > cbBufferSize)
+ if ((cbStride * (prc->Height-1)) + ((prc->Width * This->decode_info.bpp) + 7)/8 > cbBufferSize)
return E_INVALIDARG;
min_tile_x = prc->X / This->decode_info.tile_width;
--
2.20.1