[Mesa-dev] [PATCH mesa 1/3] nv30: Fix max width / height checks in nv30 sifm code

Ilia Mirkin imirkin at alum.mit.edu
Mon Sep 7 12:52:36 PDT 2015


Yeah, I noticed this was odd too when looking over the code earlier.
Glad you picked up on that as well.

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable at lists.freedesktop.org>

On Mon, Sep 7, 2015 at 3:50 PM, Hans de Goede <hdegoede at redhat.com> wrote:
> The sifm object has a limit of 1024x1024 for its input size and 2048x2048
> for its output. The code checking this was trying to be clever resulting
> in it seeing a surface of e.g 1024x256 being outside of the input size
> limit.
>
> This commit fixes this.
>
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  src/gallium/drivers/nouveau/nv30/nv30_transfer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_transfer.c b/src/gallium/drivers/nouveau/nv30/nv30_transfer.c
> index 214da65..2452071 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_transfer.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_transfer.c
> @@ -371,7 +371,7 @@ nv30_transfer_rect_blit(XFER_ARGS)
>  static bool
>  nv30_transfer_sifm(XFER_ARGS)
>  {
> -   if (!src->pitch || (src->w | src->h) > 1024 || src->w < 2 || src->h < 2)
> +   if (!src->pitch || src->w > 1024 || src->h > 1024 || src->w < 2 || src->h < 2)
>        return false;
>
>     if (src->d > 1 || dst->d > 1)
> @@ -381,7 +381,7 @@ nv30_transfer_sifm(XFER_ARGS)
>        return false;
>
>     if (!dst->pitch) {
> -      if ((dst->w | dst->h) > 2048 || dst->w < 2 || dst->h < 2)
> +      if (dst->w > 2048 || dst->h > 2048 || dst->w < 2 || dst->h < 2)
>           return false;
>     } else {
>        if (dst->domain != NOUVEAU_BO_VRAM)
> --
> 2.4.3
>


More information about the mesa-dev mailing list