[PATCH] gdiplus: Check status as well before using bitmap
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Sun Jan 12 17:28:58 CST 2020
This fixes the following scenario
Function image.c:decode_frame_wic
IWICBitmapSource_GetSize returns S_OK
GdipCreateBitmapFromScan0 returns OutOfMemory
Attempts to acess bitmap which GdipCreateBitmapFromScan0 didn't return.
Also, this makes all the if conditions consistent.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
dlls/gdiplus/image.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index 1966401507..354801348e 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -3683,7 +3683,7 @@ static GpStatus decode_frame_wic(IWICBitmapDecoder *decoder, BOOL force_conversi
IWICBitmapSource_Release(source);
}
- if (SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr) && status == Ok) {
bitmap->metadata_reader = NULL;
if (metadata_reader)
--
2.17.1
More information about the wine-devel
mailing list