swrast: Move assert for 'slice' in to check_map_teximage
authorAnuj Phogat <anuj.phogat@gmail.com>
Mon, 14 Mar 2016 17:25:50 +0000 (10:25 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Mon, 21 Mar 2016 21:55:18 +0000 (14:55 -0700)
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
src/mesa/swrast/s_texture.c

index 9ccd0e34702ea6c5cdd1d33f6367aaa8f67d6677..25918e3e037168fac8936488a307360e315f00d8 100644 (file)
@@ -188,6 +188,7 @@ check_map_teximage(const struct gl_texture_image *texImage,
    assert(y < texImage->Height || texImage->Height == 0);
    assert(x + w <= texImage->Width);
    assert(y + h <= texImage->Height);
+   assert(slice < texture_slices(texImage));
 }
 
 /**
@@ -240,7 +241,6 @@ _swrast_map_teximage(struct gl_context *ctx,
    assert(swImage->Buffer);
    assert(swImage->Buffer == swImage->ImageSlices[0]);
 
-   assert(slice < texture_slices(texImage));
    map = swImage->ImageSlices[slice];
 
    /* apply x/y offset to map address */