Hey,

On Fri, Oct 24, 2014 at 03:10:29PM +0200, Marc-André Lureau wrote:
> Avoid unnecessary allocation (and possibly leaking) if the RedDrawable
> doesn't validate_drawable_bbox()
> 
> Related to: rhbz#1135372
> ---
>  server/red_worker.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/server/red_worker.c b/server/red_worker.c
> index e177b68..d56db35 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -4068,6 +4068,11 @@ static Drawable *get_drawable(RedWorker *worker, 
> uint8_t effect, RedDrawable *re
>      struct timespec time;
>      int x;
>  

You'll need to move the
VALIDATE_SURFACE_RETVAL(worker, drawable->surface_id, NULL);
check before calling  validate_drawable_bbox() (or into that call).

> +    if (!validate_drawable_bbox(worker, red_drawable)) {
> +        rendering_incorrect(__func__);
> +        return NULL;
> +    }
> +


Christophe

Attachment: pgpqzfb4JJAzL.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to