radeon: properly check if image should be placed in the miptree
authorMaciej Cencora <m.cencora@gmail.com>
Wed, 2 Dec 2009 22:03:51 +0000 (23:03 +0100)
committerMaciej Cencora <m.cencora@gmail.com>
Thu, 3 Dec 2009 19:23:22 +0000 (20:23 +0100)
Fixes #25355

src/mesa/drivers/dri/radeon/radeon_texture.c

index 0390d376ba231b2cc22229da846510b3219d7e32..00e0658dc5454924aea166fc1a4f245ad7f27f81 100644 (file)
@@ -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;