Fix out-of-bounds error found by valgrind
authorMathis Rosenhauer <rosenhauer@dkrz.de>
Sun, 7 Oct 2012 09:29:57 +0000 (11:29 +0200)
committerThomas Jahns <jahns@dkrz.de>
Tue, 19 Feb 2013 10:33:00 +0000 (11:33 +0100)
src/encode.c

index ea2b53e..0680de1 100644 (file)
@@ -280,7 +280,7 @@ static int m_check_zero_block(struct aec_stream *strm)
     uint32_t *p = state->block_p + state->ref;
     uint32_t *end = state->block_p + strm->block_size;
 
-    while(*p == 0 && p < end)
+    while(p < end && *p == 0)
         p++;
 
     if (p < end) {