fix for bug #280: UMR in next->bits

exit as early as possible upon error.

Change-Id: I4f7702228a146c31cab3c3d21079fa1fe6904cb2
This commit is contained in:
Pascal Massimino 2015-12-15 14:05:13 +01:00
parent 578beeb8a0
commit c0f7cc47f2

View File

@ -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;