Re: [PATCH spice] Validate RedDrawable bbox before allocating drawable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: pgpOGv7d75TOF.pgp
Description: PGP signature

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

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]