Mesa (staging/21.1): i965: don't crash on incorrect texture use

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 30 20:12:55 UTC 2021


Module: Mesa
Branch: staging/21.1
Commit: cbe376fa18e7795ec5dcd366836a93ac2e64fc4f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cbe376fa18e7795ec5dcd366836a93ac2e64fc4f

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>
(cherry picked from commit 02dd03ff3ce07362c1c1636d537f90ad96c87c49)

---

 .pick_status.json                            | 2 +-
 src/mesa/drivers/dri/i965/brw_tex_validate.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index e818c54e27b..5b36ef9ef8a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -499,7 +499,7 @@
         "description": "i965: don't crash on incorrect texture use",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/mesa/drivers/dri/i965/brw_tex_validate.c b/src/mesa/drivers/dri/i965/brw_tex_validate.c
index 43fbcdc7509..b3af6b14f37 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