mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 12:28:26 +01:00
dec/vp8: avoid setting decoder status twice
Has the potential of returning confusing USER_ABORT for bitstream errors in some cases. Change-Id: I358fdb0b36549179df6dc2a95c09a872bd35aa24
This commit is contained in:
parent
2f66668882
commit
900285dac3
@ -74,9 +74,15 @@ void VP8Delete(VP8Decoder* const dec) {
|
|||||||
|
|
||||||
int VP8SetError(VP8Decoder* const dec,
|
int VP8SetError(VP8Decoder* const dec,
|
||||||
VP8StatusCode error, const char* const msg) {
|
VP8StatusCode error, const char* const msg) {
|
||||||
|
// TODO This check would be unnecessary if alpha decompression was separated
|
||||||
|
// from VP8ProcessRow/FinishRow. This avoids setting 'dec->status_' to
|
||||||
|
// something other than VP8_STATUS_BITSTREAM_ERROR on alpha decompression
|
||||||
|
// failure.
|
||||||
|
if (dec->status_ == VP8_STATUS_OK) {
|
||||||
dec->status_ = error;
|
dec->status_ = error;
|
||||||
dec->error_msg_ = msg;
|
dec->error_msg_ = msg;
|
||||||
dec->ready_ = 0;
|
dec->ready_ = 0;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user