From: Bartosz Kosiorek <gang65@poczta.onet.pl> --- dlls/gdiplus/image.c | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index ee89b11ffc0..f7d1aa5e549 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1551,8 +1551,18 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap, if (!bitmap || !hbmReturn) return InvalidParameter; if (!image_lock(&bitmap->image)) return ObjectBusy; - GdipGetImageWidth(&bitmap->image, &width); - GdipGetImageHeight(&bitmap->image, &height); + stat = GdipGetImageWidth(&bitmap->image, &width); + if (stat != Ok) + { + image_unlock(&bitmap->image); + return stat; + } + stat = GdipGetImageHeight(&bitmap->image, &height); + if (stat != Ok) + { + image_unlock(&bitmap->image); + return stat; + } bih.biSize = sizeof(bih); bih.biWidth = width; @@ -4704,8 +4714,12 @@ static GpStatus encode_frame_wic(IWICBitmapEncoder *encoder, GpImage *image) bitmap = (GpBitmap*)image; - GdipGetImageWidth(image, &width); - GdipGetImageHeight(image, &height); + stat = GdipGetImageWidth(image, &width); + if (stat != Ok) + return stat; + stat = GdipGetImageHeight(image, &height); + if (stat != Ok) + return stat; rc.X = 0; rc.Y = 0; @@ -5787,8 +5801,12 @@ GpStatus WINGDIPAPI GdipGetImageThumbnail(GpImage *image, UINT width, UINT heigh if (!width) width = 120; if (!height) height = 120; - GdipGetImageWidth(image, &srcwidth); - GdipGetImageHeight(image, &srcheight); + stat = GdipGetImageWidth(image, &srcwidth); + if (stat != Ok) + return stat; + stat = GdipGetImageHeight(image, &srcheight); + if (stat != Ok) + return stat; stat = GdipCreateBitmapFromScan0(width, height, 0, PixelFormat32bppPARGB, NULL, (GpBitmap**)ret_image); @@ -6063,8 +6081,12 @@ GpStatus WINGDIPAPI GdipBitmapGetHistogram(GpBitmap *bitmap, HistogramFormat for return InvalidParameter; } - GdipGetImageWidth(&bitmap->image, &width); - GdipGetImageHeight(&bitmap->image, &height); + stat = GdipGetImageWidth(&bitmap->image, &width); + if (stat != Ok) + return stat; + stat = GdipGetImageHeight(&bitmap->image, &height); + if (stat != Ok) + return stat; for (y = 0; y < height; y++) for (x = 0; x < width; x++) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10480