Dmitry Timoshkov : gdi: If there is no space for strings GetOutlineTextMetricsA should not indicate that they present .

Alexandre Julliard julliard at wine.codeweavers.com
Wed Sep 20 13:26:57 CDT 2006


Module: wine
Branch: master
Commit: e41c0acc0c16713d23c926f8442e651e034f99db
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=e41c0acc0c16713d23c926f8442e651e034f99db

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Mon Sep 18 19:00:44 2006 +0900

gdi: If there is no space for strings GetOutlineTextMetricsA should not indicate that they present.

---

 dlls/gdi/font.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi/font.c b/dlls/gdi/font.c
index a4327de..42b4925 100644
--- a/dlls/gdi/font.c
+++ b/dlls/gdi/font.c
@@ -1483,6 +1483,20 @@ UINT WINAPI GetOutlineTextMetricsA(
     if(output != lpOTM) {
         memcpy(lpOTM, output, cbData);
         HeapFree(GetProcessHeap(), 0, output);
+
+        /* check if the string offsets really fit into the provided size */
+        /* FIXME: should we check string length as well? */
+        if ((UINT_PTR)lpOTM->otmpFamilyName >= lpOTM->otmSize)
+            lpOTM->otmpFamilyName = 0; /* doesn't fit */
+
+        if ((UINT_PTR)lpOTM->otmpFaceName >= lpOTM->otmSize)
+            lpOTM->otmpFaceName = 0; /* doesn't fit */
+
+        if ((UINT_PTR)lpOTM->otmpStyleName >= lpOTM->otmSize)
+            lpOTM->otmpStyleName = 0; /* doesn't fit */
+
+        if ((UINT_PTR)lpOTM->otmpFullName >= lpOTM->otmSize)
+            lpOTM->otmpFullName = 0; /* doesn't fit */
     }
 
 end:




More information about the wine-cvs mailing list