Module: wine Branch: master Commit: 3c59fb2071c225dd9bb0b5d0fe45e3376e3b5f91 URL: https://gitlab.winehq.org/wine/wine/-/commit/3c59fb2071c225dd9bb0b5d0fe45e33...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Thu Jun 6 11:28:04 2024 +0200
gdi32/text: Handle null partial extents pointer in GetTextExtentExPointW().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56788 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
---
dlls/gdi32/text.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/text.c b/dlls/gdi32/text.c index 085c5e3afbe..ff548306dc3 100644 --- a/dlls/gdi32/text.c +++ b/dlls/gdi32/text.c @@ -1421,8 +1421,11 @@ BOOL WINAPI GetTextExtentExPointW( HDC hdc, const WCHAR *str, INT count, INT max if (extents + cluster_extent > max_ext) break; if (nfit) *nfit += cluster_size;
- for (j = 0; j < cluster_size; ++j) - dxs[i + j] = extents + cluster_extent / cluster_size; + if (dxs) + { + for (j = 0; j < cluster_size; ++j) + dxs[i + j] = extents + cluster_extent / cluster_size; + }
extents += cluster_extent; }