Shawn M. Chapla : gdiplus: Add missing allocation failure checks to graphics functions.
Alexandre Julliard
julliard at winehq.org
Wed Aug 26 15:24:45 CDT 2020
Module: wine
Branch: master
Commit: c155b043fd62e2482d05fa62ad5382d96a2e9823
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c155b043fd62e2482d05fa62ad5382d96a2e9823
Author: Shawn M. Chapla <schapla at codeweavers.com>
Date: Tue Aug 25 18:13:39 2020 -0400
gdiplus: Add missing allocation failure checks to graphics functions.
Signed-off-by: Shawn M. Chapla <schapla at codeweavers.com>
Signed-off-by: Esme Povirk <esme at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdiplus/graphics.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 5702200324..c3542b3d65 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -5192,7 +5192,14 @@ GpStatus gdip_format_string(HDC hdc,
}
if (hotkeyprefix_count)
+ {
hotkeyprefix_offsets = heap_alloc_zero(sizeof(INT) * hotkeyprefix_count);
+ if (!hotkeyprefix_offsets)
+ {
+ heap_free(stringdup);
+ return OutOfMemory;
+ }
+ }
hotkeyprefix_count = 0;
@@ -6555,6 +6562,7 @@ GpStatus WINGDIPAPI GdipDrawPolygonI(GpGraphics *graphics,GpPen *pen,GDIPCONST G
if(count<=0) return InvalidParameter;
ptf = heap_alloc_zero(sizeof(GpPointF) * count);
+ if (!ptf) return OutOfMemory;
for(i = 0;i < count; i++){
ptf[i].X = (REAL)points[i].X;
More information about the wine-cvs
mailing list