[PATCH] exa: don't need to check for NULL pointer if we already assumed it has a value
Daniel Stone
daniel at fooishbar.org
Mon Apr 19 00:21:25 PDT 2010
On Sat, Apr 17, 2010 at 08:45:38AM -0700, Dan Nicholson wrote:
> It seems it would be better to check ps unless you're pretty sure
> pScreen always has a PictureScreen.
>
> Looking at this code showed me another "bug".
>
> #ifdef RENDER
> PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
> #endif
>
> if (ps->Glyphs == exaGlyphs)
> exaGlyphsFini(pScreen);
>
> Shouldn't this whole block be under RENDER like the later accesses to
> ps? Incidentally, if you just change the conditional to "if (ps &&
> ps->Glyphs == exaGlyphs)", then the NULL pointer won't be dereferenced
> either.
Eh. This is configure.ac ... from 1st July, 2005:
dnl
dnl A bunch of configuration values which shouldn't be optional
dnl
AC_DEFINE(RENDER,1,[Support RENDER extension])
EXTENSION_LIBS="$EXTENSION_LIBS "'$(top_builddir)/render/librender.la'
EXTENSION_INCS="$EXTENSION_INCS "'-I$(top_srcdir)/render'
Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100419/70d89b73/attachment.pgp>
More information about the xorg-devel
mailing list