[PATCH v2] gdi32: Avoid visrect that exceed the actual bitmap size.

Huw Davies huw at codeweavers.com
Thu Nov 12 04:39:19 CST 2020


On Wed, Nov 11, 2020 at 02:04:33PM +0800, Haoyang Chen wrote:
>  dlls/gdi32/dib.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c
> index 10a7a957973..2c83f4127f2 100644
> --- a/dlls/gdi32/dib.c
> +++ b/dlls/gdi32/dib.c
> @@ -824,7 +824,9 @@ INT CDECL nulldrv_SetDIBitsToDevice( PHYSDEV dev, INT x_dst, INT y_dst, DWORD cx
>              }
>              else if (src.y >= lines) return lines;
>          }
> -        src_info->bmiHeader.biHeight = top_down ? -lines : lines;
> +
> +        if (lines < height)
> +            src_info->bmiHeader.biHeight = top_down ? -lines : lines;
>          src_info->bmiHeader.biSizeImage = get_dib_image_size( src_info );
>      }

Thanks for the patch.  I've modified it slightly and sent in a v3.

Huw.



More information about the wine-devel mailing list