From 7288950b883dd1981e3d0a4f05b301ce6390dac5 Mon Sep 17 00:00:00 2001 From: Urvang Joshi Date: Mon, 17 Jun 2013 03:45:09 -0700 Subject: [PATCH] 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. Conflicts: src/dec/vp8l.c Change-Id: I6c665a6cfbd9bd10651c1e82fa54e687cbd54a2b (cherry picked from commit a37eff47d6b6f0a3721a9710235cd894c2982e9b) --- src/dec/vp8l.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dec/vp8l.c b/src/dec/vp8l.c index 1f618e82..89b5b4bf 100644 --- a/src/dec/vp8l.c +++ b/src/dec/vp8l.c @@ -1142,11 +1142,12 @@ int VP8LDecodeAlphaImageStream(int width, int height, const uint8_t* const data, dec->action_ = READ_HDR; if (!DecodeImageStream(width, height, 1, dec, NULL)) goto Err; - // Special case: if alpha data contains only the color indexing transform - // (a frequent case), we will use DecodeAlphaData() method that only needs - // allocation of 1 byte per pixel (alpha channel). + // Special case: if alpha data uses only the color indexing transform and + // doesn't use color cache (a frequent case), we will use DecodeAlphaData() + // method that only needs allocation of 1 byte per pixel (alpha channel). 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) { bytes_per_pixel = sizeof(uint8_t); }