Merge "dec/vp8: avoid setting decoder status twice"

This commit is contained in:
pascal massimino 2012-06-18 14:12:21 -07:00 committed by Gerrit Code Review
commit ce614c0caf

View File

@ -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) {
dec->status_ = error; // TODO This check would be unnecessary if alpha decompression was separated
dec->error_msg_ = msg; // from VP8ProcessRow/FinishRow. This avoids setting 'dec->status_' to
dec->ready_ = 0; // something other than VP8_STATUS_BITSTREAM_ERROR on alpha decompression
// failure.
if (dec->status_ == VP8_STATUS_OK) {
dec->status_ = error;
dec->error_msg_ = msg;
dec->ready_ = 0;
}
return 0; return 0;
} }