Mesa (main): i965: don't crash on incorrect texture use
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 29 02:04:42 UTC 2021
Module: Mesa
Branch: main
Commit: 02dd03ff3ce07362c1c1636d537f90ad96c87c49
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=02dd03ff3ce07362c1c1636d537f90ad96c87c49
Author: Timothy Arceri <tarceri at itsqueeze.com>
Date: Mon Jun 28 14:26:54 2021 +1000
i965: don't crash on incorrect texture use
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4995
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11603>
---
src/mesa/drivers/dri/i965/brw_tex_validate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_tex_validate.c b/src/mesa/drivers/dri/i965/brw_tex_validate.c
index 696655673fd..36803cc2640 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_validate.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_validate.c
@@ -104,6 +104,8 @@ brw_finalize_mipmap_tree(struct brw_context *brw,
assert(!tObj->Immutable || brw->screen->devinfo.ver < 6);
firstImage = brw_texture_image(tObj->Image[0][tObj->Attrib.BaseLevel]);
+ if (!firstImage)
+ return;
/* Check tree can hold all active levels. Check tree matches
* target, imageFormat, etc.
More information about the mesa-commit
mailing list