[GDI32]
[reactos.git] / reactos / dll / win32 / gdi32 / objects / text.c
index e524571..d64e012 100644 (file)
@@ -192,6 +192,13 @@ GetTextExtentExPointW(
        LPSIZE  lpSize
        )
 {
+
+  if(nMaxExtent < -1)
+  {
+    SetLastError(ERROR_INVALID_PARAMETER);
+    return FALSE;
+  }
+
   return NtGdiGetTextExtentExW (
     hdc, (LPWSTR)lpszStr, cchString, nMaxExtent, (PULONG)lpnFit, (PULONG)alpDx, lpSize, 0 );
 }
@@ -216,6 +223,12 @@ GetTextExtentExPointA(
   LPWSTR lpszStrW;
   BOOL rc = 0;
 
+  if(nMaxExtent < -1)
+  {
+    SetLastError(ERROR_INVALID_PARAMETER);
+    return FALSE;
+  }
+
   Status = HEAP_strdupA2W ( &lpszStrW, lpszStr );
   if (!NT_SUCCESS (Status))
     SetLastError (RtlNtStatusToDosError(Status));