Commit add860c4 authored by jzern's avatar jzern Committed by Commit bot

libwebp: port lossless incremental decoding fix

f8fad4fa lossless incremental decoding: fix missing eos_ test

use if (br->eos_) break; as this snapshot does not contain:
16be192f VP8LSetBitPos: remove the eos_ setting

original commit message:

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.

(https://chromium.googlesource.com/webm/libwebp/+/21735e06f7c1cb35562754e7f54365f24124ef15)

BUG=webp:332

Review-Url: https://codereview.chromium.org/2729473002
Cr-Commit-Position: refs/heads/master@{#455989}
parent b1575e90
...@@ -27,3 +27,4 @@ Local changes: ...@@ -27,3 +27,4 @@ Local changes:
Cherry-picks: Cherry-picks:
Revert patch f7fc4bc: dec/webp.c: don't wait for data before reporting w/h Revert patch f7fc4bc: dec/webp.c: don't wait for data before reporting w/h
Revert patch d1c359e: fix shared object build with -fvisibility=hidden Revert patch d1c359e: fix shared object build with -fvisibility=hidden
f8fad4fa lossless incremental decoding: fix missing eos_ test
...@@ -1090,6 +1090,7 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data, ...@@ -1090,6 +1090,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 (br->eos_) 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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment