st/xorg: fix crash triggered by rendercheck -t blend -f a8r8g8b8 -o Clear
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Mon, 16 May 2011 19:52:05 +0000 (21:52 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 20 Jun 2011 00:11:12 +0000 (02:11 +0200)
src/gallium/state_trackers/xorg/xorg_composite.c

index d4dc84a122b1a6bfa16bef5cb2b2f45127addde9..b5dacd20bb5d0397dadd065742556490adeb8daf 100644 (file)
@@ -237,7 +237,7 @@ picture_format_fixups(struct exa_pixmap_priv *pSrc, PicturePtr pSrcPicture, bool
    boolean swizzle = FALSE;
    unsigned ret = 0;
 
-   if (pSrc->picture_format == pSrcPicture->format) {
+   if (pSrc && pSrc->picture_format == pSrcPicture->format) {
       if (pSrc->picture_format == PICT_a8) {
          if (mask)
             return FS_MASK_LUMINANCE;
@@ -252,7 +252,7 @@ picture_format_fixups(struct exa_pixmap_priv *pSrc, PicturePtr pSrcPicture, bool
       return 0;
    }
 
-   if (pSrc->picture_format != PICT_a8r8g8b8) {
+   if (pSrc && pSrc->picture_format != PICT_a8r8g8b8) {
       assert(!"can not handle formats");
       return 0;
    }