gdiplus: Always treat out of range string sizes as INT_MAX.
authorVincent Povirk <vincent@codeweavers.com>
Sat, 8 May 2010 21:32:18 +0000 (16:32 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 10 May 2010 08:03:00 +0000 (10:03 +0200)
dlls/gdiplus/graphics.c

index 879646a826391768fcbf5fbe20528dfd5e345a85..68e422e9f16138c0d311777ce007cabf891a726f 100644 (file)
@@ -3544,8 +3544,8 @@ static GpStatus gdip_format_string(GpGraphics *graphics,
     nwidth = roundr(rect->Width);
     nheight = roundr(rect->Height);
 
-    if (nwidth == 0 || rect->Width >= INT_MAX) nwidth = INT_MAX;
-    if (nheight == 0 || rect->Height >= INT_MAX) nheight = INT_MAX;
+    if (rect->Width >= INT_MAX || rect->Width < 0.5) nwidth = INT_MAX;
+    if (rect->Height >= INT_MAX || rect->Width < 0.5) nheight = INT_MAX;
 
     for(i = 0, j = 0; i < length; i++){
         /* FIXME: This makes the indexes passed to callback inaccurate. */