gdiplus: Handle large input rect in GdipMeasureCharacterRanges.
Vincent Povirk
madewokherd at gmail.com
Mon Mar 23 15:25:16 CDT 2015
-------------- next part --------------
From fe884bf7cea1bbd6336c4fd50c8532a73b5b5a9b Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
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 34022cb..ae530a9 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);
--
2.1.0
More information about the wine-patches
mailing list