From: Vinson Lee Date: Sat, 27 Feb 2010 22:56:27 +0000 (-0800) Subject: unichrome: Assert that pointer is not null before dereferencing. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e31a37966154cc8171a8663cf5aa4ef1dd070f97;p=mesa.git unichrome: Assert that pointer is not null before dereferencing. --- diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c index c9a31f3383c..25aad1b204e 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.c +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c @@ -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;