From: Ian Romanick <ian.d.roman...@intel.com>

This fixes the segfault in the 'invalid slice of 3D texture' and
'invalid layer of an array texture' subtests of piglit's fbo-incomplete
test.

The 'invalid layer of an array texture' subtest still fails.

Signed-off-by: Ian Romanick <ian.d.roman...@intel.com>
Cc: mesa-sta...@lists.freedesktop.org
---
 src/mesa/main/fbobject.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index f10af41..b393d91 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -355,6 +355,9 @@ driver_RenderTexture_is_safe(const struct 
gl_renderbuffer_attachment *att)
    if (texImage->Width == 0 || texImage->Height == 0 || texImage->Depth == 0)
       return false;
 
+   if (att->Zoffset > texImage->Depth)
+      return false;
+
    return true;
 }
 
-- 
1.8.1.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to