unichrome: Assert that pointer is not null before dereferencing.
authorVinson Lee <vlee@vmware.com>
Sat, 27 Feb 2010 22:56:27 +0000 (14:56 -0800)
committerVinson Lee <vlee@vmware.com>
Sat, 27 Feb 2010 22:56:27 +0000 (14:56 -0800)
src/mesa/drivers/dri/unichrome/via_ioctl.c

index c9a31f3383c8a270ec3487c8d6133e6fee9c9ced..25aad1b204e5f7f18984ede8a9ef1949b0a1aeb7 100644 (file)
@@ -757,6 +757,8 @@ static void via_emit_cliprect(struct via_context *vmesa,
    vb[0] = HC_HEADER2;
    vb[1] = (HC_ParaType_NotTex << 16);
 
+   assert(vmesa->driDrawable);
+
    if (vmesa->driDrawable->w == 0 || vmesa->driDrawable->h == 0) {
       vb[2] = (HC_SubA_HClipTB << 24) | 0x0;
       vb[3] = (HC_SubA_HClipLR << 24) | 0x0;