diff options
author | Vinson Lee <vlee@vmware.com> | 2010-04-17 23:40:14 -0700 |
---|---|---|
committer | Vinson Lee <vlee@vmware.com> | 2010-04-17 23:40:14 -0700 |
commit | 010f81f32b9e68b768b3436f98953f1d1c0bf1d4 (patch) | |
tree | be41091d3bd3bb68df2f3725531811b431a42640 /src/gallium/state_trackers/dri | |
parent | 63c6d6add16ec3ddbc42a13eef0c07d96255b009 (diff) |
st/dri: Check for NULL before dereference and assignment.
Diffstat (limited to 'src/gallium/state_trackers/dri')
-rw-r--r-- | src/gallium/state_trackers/dri/drm/dri1.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/dri/drm/dri1.c b/src/gallium/state_trackers/dri/drm/dri1.c index bdf251653d..e216e46a87 100644 --- a/src/gallium/state_trackers/dri/drm/dri1.c +++ b/src/gallium/state_trackers/dri/drm/dri1.c @@ -89,10 +89,18 @@ dri1_propagate_drawable_change(struct dri_context *ctx) { __DRIdrawable *dPriv = ctx->dPriv; __DRIdrawable *rPriv = ctx->rPriv; - struct dri_drawable *draw = dri_drawable(dPriv); - struct dri_drawable *read = dri_drawable(rPriv); + struct dri_drawable *draw; + struct dri_drawable *read; boolean flushed = FALSE; + if (dPriv) { + draw = dri_drawable(dPriv); + } + + if (rPriv) { + read = dri_drawable(rPriv); + } + if (dPriv && draw->texture_stamp != dPriv->lastStamp) { ctx->st->flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL); flushed = TRUE; |