[PATCH 1/2] gdi32: Fail in ExtTextOut if count is -1.

Akihiro Sagawa sagawa.aki at gmail.com
Fri Jan 29 22:15:31 CST 2021


On Fri, 29 Jan 2021 19:12:56 +0200, Gabriel Ivăncescu wrote:
> Some applications pass this and crash when BIDI_Reorder can't allocate
> the memory.
> 
> Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
> ---
>  dlls/gdi32/font.c           | 1 +
>  dlls/gdi32/tests/font.c     | 2 ++
>  dlls/gdi32/tests/metafile.c | 8 +++++++-
>  3 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
> index 74ca482..c0517f5 100644
> --- a/dlls/gdi32/font.c
> +++ b/dlls/gdi32/font.c
> @@ -5932,6 +5932,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
>      static int quietfixme = 0;
>  
>      if (!dc) return FALSE;
> +    if (count == -1) return FALSE;

From my point of view, you might want to use '> INT_MAX' instead of
'== -1'. BIDI_Reorder expects a singed integer while count variable is
an unsigned one.

Akihiro Sagawa




More information about the wine-devel mailing list