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@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11603>
This commit is contained in:
Timothy Arceri 2021-06-28 14:26:54 +10:00 committed by Marge Bot
parent 328ea8e04a
commit 02dd03ff3c
1 changed files with 2 additions and 0 deletions

View File

@ -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.