From 4509e32e6394952c8cc5b161527c02f7c4f27a87 Mon Sep 17 00:00:00 2001 From: Urvang Joshi Date: Fri, 23 Jan 2015 15:10:49 -0800 Subject: [PATCH] Lossless decoding: Remove an unnecessary if condition. Change-Id: I4e32da538d7b8563305124fb5faa1f7ce8a976d1 --- src/dec/vp8l.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/dec/vp8l.c b/src/dec/vp8l.c index c8f2bb18..9c213de6 100644 --- a/src/dec/vp8l.c +++ b/src/dec/vp8l.c @@ -1073,12 +1073,13 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data, process_func(dec, row); } } - if (src < src_end) { - if (col & mask) htree_group = GetHtreeGroupForPos(hdr, col, row); - if (color_cache != NULL) { - while (last_cached < src) { - VP8LColorCacheInsert(color_cache, *last_cached++); - } + // Because of the check done above (before 'src' was incremented by + // 'length'), the following holds true. + assert(src <= src_end); + if (col & mask) htree_group = GetHtreeGroupForPos(hdr, col, row); + if (color_cache != NULL) { + while (last_cached < src) { + VP8LColorCacheInsert(color_cache, *last_cached++); } } } else if (code < color_cache_limit) { // Color cache