sw/xlib: avoid dereferencing a null pointer
authorBrian Paul <brianp@vmware.com>
Thu, 27 May 2010 18:30:45 +0000 (12:30 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 27 May 2010 19:40:16 +0000 (13:40 -0600)
src/gallium/winsys/sw/xlib/xlib_sw_winsys.c

index 3d702ae08dcdd719ad35068b3313d6ba4ba4141b..b78f537c12587bf807b398e4144aadac85e153c4 100644 (file)
@@ -255,7 +255,7 @@ xm_displaytarget_destroy(struct sw_winsys *ws,
       }
       else {
          FREE(xm_dt->data);
-         if (xm_dt->tempImage->data == xm_dt->data) {
+         if (xm_dt->tempImage && xm_dt->tempImage->data == xm_dt->data) {
             xm_dt->tempImage->data = NULL;
          }
          xm_dt->data = NULL;