Re: [PATCH xf86-video-qxl] Initialize the frame buffer used in dfps mode; this silences a number of valgrind errors.

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

 



Any idea in which situation we are trying to access uninitialized pixmap
memory?
Apart from that, why not.

Christophe

On Fri, Sep 12, 2014 at 02:20:36PM -0500, Jeremy White wrote:
> 
> Signed-off-by: Jeremy White <jwhite@xxxxxxxxxxxxxxx>
> ---
>  src/dfps.c |   14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/src/dfps.c b/src/dfps.c
> index 5db34dc..568ba5e 100644
> --- a/src/dfps.c
> +++ b/src/dfps.c
> @@ -312,6 +312,17 @@ static void dfps_set_screen_pixmap (PixmapPtr pixmap)
>      pixmap->drawable.pScreen->devPrivate = pixmap;
>  }
>  
> +static void dfps_clear_pixmap(PixmapPtr pixmap, int w, int h)
> +{
> +    GCPtr pgc;
> +    pgc = GetScratchGC(pixmap->drawable.depth, pixmap->drawable.pScreen);
> +    if (pgc)
> +    {
> +        fbFill(&pixmap->drawable, pgc, 0, 0, w, h);
> +        FreeScratchGC(pgc);
> +    }
> +}
> +
>  static PixmapPtr dfps_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usage)
>  {
>      PixmapPtr pixmap;
> @@ -324,7 +335,10 @@ static PixmapPtr dfps_create_pixmap (ScreenPtr screen, int w, int h, int depth,
>  
>      pixmap = fbCreatePixmap (screen, w, h, depth, usage);
>      if (pixmap)
> +    {
> +        dfps_clear_pixmap(pixmap, w, h);
>          dfps_set_info(pixmap, info);
> +    }
>      else
>          free(info);
>  
> -- 
> 1.7.10.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: pgpsx6EcbU_mA.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]