- otherwise, it generates a warning in destroy_region()
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/gdi32/region.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c index 8555be96f72..d769ea5ad98 100644 --- a/dlls/gdi32/region.c +++ b/dlls/gdi32/region.c @@ -412,7 +412,11 @@ static BOOL init_region( WINEREGION *pReg, INT n )
if (n > RGN_DEFAULT_RECTS) { - if (n > INT_MAX / sizeof(RECT)) return FALSE; + if (n > INT_MAX / sizeof(RECT)) + { + pReg->rects = NULL; + return FALSE; + } if (!(pReg->rects = malloc( n * sizeof( RECT ) ))) return FALSE; }