fix bug in alpha.c that was triggering a memory error in incremental mode

this change will be superseded by patch #335160 eventually, but until then
let's fix the problem temporarily.

Change-Id: Iafd979c2ff6801e3f1de4614870ca854a4747b04
This commit is contained in:
Pascal Massimino 2016-04-01 00:59:39 -07:00
parent 9a950c5375
commit 8dca0247d2

View File

@ -131,6 +131,8 @@ const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec,
return NULL; // sanity check.
}
if (!dec->is_alpha_decoded_) {
int ok;
if (dec->alph_dec_ == NULL) { // Initialize decoder.
assert(dec->alpha_plane_ != NULL);
dec->alph_dec_ = ALPHNew();
@ -153,8 +155,7 @@ const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec,
num_rows = height - row;
}
if (!dec->is_alpha_decoded_) {
int ok = ALPHDecode(dec, row, num_rows);
ok = ALPHDecode(dec, row, num_rows);
assert(dec->alph_dec_ != NULL);
if (!ok || dec->is_alpha_decoded_) {
ALPHDelete(dec->alph_dec_);