freedreno: fix crash in fd_invalidate_resource()

Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
Rob Clark 2015-07-02 18:15:43 -04:00
parent ab3ba21f97
commit 422296e38d

View file

@ -72,11 +72,11 @@ fd_invalidate_resource(struct fd_context *ctx, struct pipe_resource *prsc)
/* Textures */
for (i = 0; i < ctx->verttex.num_textures && !(ctx->dirty & FD_DIRTY_VERTTEX); i++) {
if (ctx->verttex.textures[i]->texture == prsc)
if (ctx->verttex.textures[i] && (ctx->verttex.textures[i]->texture == prsc))
ctx->dirty |= FD_DIRTY_VERTTEX;
}
for (i = 0; i < ctx->fragtex.num_textures && !(ctx->dirty & FD_DIRTY_FRAGTEX); i++) {
if (ctx->fragtex.textures[i]->texture == prsc)
if (ctx->fragtex.textures[i] && (ctx->fragtex.textures[i]->texture == prsc))
ctx->dirty |= FD_DIRTY_FRAGTEX;
}
}