From c7a0ea469be0c110a0c0a7db82164b68f7510990 Mon Sep 17 00:00:00 2001 From: Mathis Rosenhauer Date: Sun, 7 Oct 2012 11:29:57 +0200 Subject: [PATCH] Fix out-of-bounds error found by valgrind --- src/encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encode.c b/src/encode.c index ea2b53e..0680de1 100644 --- a/src/encode.c +++ b/src/encode.c @@ -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) { -- 2.7.4