On 04/16/2013 06:33 PM, Dave Airlie wrote:
From: Dave Airlie <[email protected]>

Since we never bail on the first failure in this test, we can return
from the GetInternalformativ without buffer_size_in_elements ever
being touched, due to misc GL error (mesa_base_fbo_format fails),
this then causes us to loop a lot later and print error messages
than make piglit eat all the pies^WRAM.

So... the underlying problem is the first call to glGetInternalformativ generates and error and doesn't write to buffer_size_in_elements. Then the call to malloc indirectly uses buffer_size_in_elements to size the allocation, and it gets used as a loop count after that. Uninitialized data is bad, m'kay.

Reviewed-by: Ian Romanick <[email protected]>

Signed-off-by: Dave Airlie <[email protected]>
---
  tests/spec/arb_internalformat_query/minmax.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/spec/arb_internalformat_query/minmax.c 
b/tests/spec/arb_internalformat_query/minmax.c
index 2f8043d..c15b954 100644
--- a/tests/spec/arb_internalformat_query/minmax.c
+++ b/tests/spec/arb_internalformat_query/minmax.c
@@ -103,7 +103,7 @@ try(GLenum target, GLenum format, GLint max_samples,
  {
        bool pass = true;
        GLint *buffer;
-       int buffer_size_in_elements;
+       int buffer_size_in_elements = 0;
        size_t buffer_size_in_bytes;
        unsigned i;
        GLint previous;


_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to