From c0f7cc47f29482558af6eee37c54176cff921aeb Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Tue, 15 Dec 2015 14:05:13 +0100 Subject: [PATCH] fix for bug #280: UMR in next->bits exit as early as possible upon error. Change-Id: I4f7702228a146c31cab3c3d21079fa1fe6904cb2 --- src/dec/vp8l.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dec/vp8l.c b/src/dec/vp8l.c index 19665a00..a76ad6a1 100644 --- a/src/dec/vp8l.c +++ b/src/dec/vp8l.c @@ -428,14 +428,14 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize, alphabet_size += 1 << color_cache_bits; } size = ReadHuffmanCode(alphabet_size, dec, code_lengths, next); + if (size == 0) { + goto Error; + } if (is_trivial_literal && kLiteralMap[j] == 1) { is_trivial_literal = (next->bits == 0); } total_size += next->bits; next += size; - if (size == 0) { - goto Error; - } if (j <= ALPHA) { int local_max_bits = code_lengths[0]; int k;