[PATCH 2/7] Check pixmap allocation return value when creating glyphs

Jamey Sharp jamey at minilop.net
Fri May 14 17:13:13 PDT 2010


Reviewed-by: Jamey Sharp <jamey at minilop.net>

On Wed, May 12, 2010 at 2:45 PM, Keith Packard <keithp at keithp.com> wrote:
> ---
>  render/render.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/render/render.c b/render/render.c
> index c9d3e8e..a3e96c0 100644
> --- a/render/render.c
> +++ b/render/render.c
> @@ -1145,6 +1145,12 @@ ProcRenderAddGlyphs (ClientPtr client)
>                                                   width, height, depth,
>                                                   CREATE_PIXMAP_USAGE_GLYPH_PICTURE);
>
> +               if (!pDstPix)
> +               {
> +                   err = BadAlloc;
> +                   goto bail;
> +               }
> +
>                GlyphPicture (glyph)[screen] = pDst =
>                        CreatePicture (0, &pDstPix->drawable,
>                                       glyphSet->format,
> @@ -1154,6 +1160,7 @@ ProcRenderAddGlyphs (ClientPtr client)
>                /* The picture takes a reference to the pixmap, so we
>                   drop ours. */
>                (pScreen->DestroyPixmap) (pDstPix);
> +               pDstPix = NULL;
>
>                if (! pDst)
>                {
> --
> 1.7.1
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>


More information about the xorg-devel mailing list