mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
Regression fix for alpha channels using color cache:
Considering the fact that insert to/lookup from the color cache is always 32 bit, use DecodeImageData() variant in that case. Change-Id: I6c665a6cfbd9bd10651c1e82fa54e687cbd54a2b
This commit is contained in:
parent
241cf99bc0
commit
a37eff47d6
@ -1157,11 +1157,12 @@ int VP8LDecodeAlphaHeader(ALPHDecoder* const alph_dec,
|
|||||||
goto Err;
|
goto Err;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special case: if alpha data contains only the color indexing transform
|
// Special case: if alpha data uses only the color indexing transform and
|
||||||
// (a frequent case), we will use DecodeAlphaData() method that only needs
|
// doesn't use color cache (a frequent case), we will use DecodeAlphaData()
|
||||||
// allocation of 1 byte per pixel (alpha channel).
|
// method that only needs allocation of 1 byte per pixel (alpha channel).
|
||||||
if (dec->next_transform_ == 1 &&
|
if (dec->next_transform_ == 1 &&
|
||||||
dec->transforms_[0].type_ == COLOR_INDEXING_TRANSFORM) {
|
dec->transforms_[0].type_ == COLOR_INDEXING_TRANSFORM &&
|
||||||
|
dec->hdr_.color_cache_size_ == 0) {
|
||||||
alph_dec->bytes_per_pixel_ = sizeof(uint8_t);
|
alph_dec->bytes_per_pixel_ = sizeof(uint8_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user