Mesa (mesa_7_7_branch): radeon: properly check if image should be placed in the miptree

Maciej Cencora osiris at kemper.freedesktop.org
Thu Dec 3 11:24:00 PST 2009


Module: Mesa
Branch: mesa_7_7_branch
Commit: 8cde43eb19c4dcceb74166e1da123d316a429c21
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8cde43eb19c4dcceb74166e1da123d316a429c21

Author: Maciej Cencora <m.cencora at gmail.com>
Date:   Wed Dec  2 23:03:51 2009 +0100

radeon: properly check if image should be placed in the miptree

Fixes #25355

---

 src/mesa/drivers/dri/radeon/radeon_texture.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 0390d37..00e0658 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -515,7 +515,10 @@ static int image_matches_texture_obj(struct gl_texture_object *texObj,
 	struct gl_texture_image *texImage,
 	unsigned level)
 {
-	const struct gl_texture_image *baseImage = texObj->Image[0][level];
+	const struct gl_texture_image *baseImage = texObj->Image[0][texObj->BaseLevel];
+
+	if (!baseImage)
+		return 0;
 
 	if (level < texObj->BaseLevel || level > texObj->MaxLevel)
 		return 0;



More information about the mesa-commit mailing list