From 6b97abf930ac40dd9a668ec1fed588fcefd192fb Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 23 Mar 2015 15:12:06 -0500 Subject: [PATCH] gdiplus: Handle large input rect in GdipMeasureCharacterRanges. --- dlls/gdiplus/graphics.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 34022cb9533..ae530a9a8f6 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4739,6 +4739,9 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, scaled_rect.Width = layoutRect->Width * args.rel_width; scaled_rect.Height = layoutRect->Height * args.rel_height; + if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23; + if (scaled_rect.Height >= 1 << 23) scaled_rect.Height = 1 << 23; + get_font_hfont(graphics, font, stringFormat, &gdifont, NULL); oldfont = SelectObject(hdc, gdifont);