lossless incremental decoding: fix missing eos_ test

The patch  21735e0 introduced a bug where a goto path was not testing
the eos_ state.  If this happened just before a row_sync, a SaveState()
would be called that would store the eos_ state as '1' till the end
of the loop.  This usually was not a problem, except for the very last
chunk where we disable the incremental decoding altogether (we have all
the data). The termination tests were then going wrong.
The fix is to add a proper eos_ test and avoid falling in this inconsistent
state.

(21735e06f7)

BUG=webp:332

Change-Id: Ib16773aee26bfd068fbf4e9db3d2313bd978b269
This commit is contained in:
Pascal Massimino 2017-02-28 13:48:04 -08:00 committed by James Zern
parent 75a9c3c452
commit f8fad4fac1

View File

@ -1091,6 +1091,7 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data,
VP8LFillBitWindow(br); VP8LFillBitWindow(br);
if (htree_group->use_packed_table) { if (htree_group->use_packed_table) {
code = ReadPackedSymbols(htree_group, br, src); code = ReadPackedSymbols(htree_group, br, src);
if (VP8LIsEndOfStream(br)) break;
if (code == PACKED_NON_LITERAL_CODE) goto AdvanceByOne; if (code == PACKED_NON_LITERAL_CODE) goto AdvanceByOne;
} else { } else {
code = ReadSymbol(htree_group->htrees[GREEN], br); code = ReadSymbol(htree_group->htrees[GREEN], br);