|
|
@ -754,11 +754,11 @@ static WEBP_INLINE HTreeGroup* GetHtreeGroupForPos(VP8LMetadata* const hdr, |
|
|
|
|
|
|
|
|
|
|
|
typedef void (*ProcessRowsFunc)(VP8LDecoder* const dec, int row); |
|
|
|
typedef void (*ProcessRowsFunc)(VP8LDecoder* const dec, int row); |
|
|
|
|
|
|
|
|
|
|
|
static void ApplyInverseTransforms(VP8LDecoder* const dec, int num_rows, |
|
|
|
static void ApplyInverseTransforms(VP8LDecoder* const dec, |
|
|
|
|
|
|
|
int start_row, int num_rows, |
|
|
|
const uint32_t* const rows) { |
|
|
|
const uint32_t* const rows) { |
|
|
|
int n = dec->next_transform_; |
|
|
|
int n = dec->next_transform_; |
|
|
|
const int cache_pixs = dec->width_ * num_rows; |
|
|
|
const int cache_pixs = dec->width_ * num_rows; |
|
|
|
const int start_row = dec->last_row_; |
|
|
|
|
|
|
|
const int end_row = start_row + num_rows; |
|
|
|
const int end_row = start_row + num_rows; |
|
|
|
const uint32_t* rows_in = rows; |
|
|
|
const uint32_t* rows_in = rows; |
|
|
|
uint32_t* const rows_out = dec->argb_cache_; |
|
|
|
uint32_t* const rows_out = dec->argb_cache_; |
|
|
@ -789,8 +789,7 @@ static void ProcessRows(VP8LDecoder* const dec, int row) { |
|
|
|
VP8Io* const io = dec->io_; |
|
|
|
VP8Io* const io = dec->io_; |
|
|
|
uint8_t* rows_data = (uint8_t*)dec->argb_cache_; |
|
|
|
uint8_t* rows_data = (uint8_t*)dec->argb_cache_; |
|
|
|
const int in_stride = io->width * sizeof(uint32_t); // in unit of RGBA
|
|
|
|
const int in_stride = io->width * sizeof(uint32_t); // in unit of RGBA
|
|
|
|
|
|
|
|
ApplyInverseTransforms(dec, dec->last_row_, num_rows, rows); |
|
|
|
ApplyInverseTransforms(dec, num_rows, rows); |
|
|
|
|
|
|
|
if (!SetCropWindow(io, dec->last_row_, row, &rows_data, in_stride)) { |
|
|
|
if (!SetCropWindow(io, dec->last_row_, row, &rows_data, in_stride)) { |
|
|
|
// Nothing to output (this time).
|
|
|
|
// Nothing to output (this time).
|
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -1193,6 +1192,7 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data, |
|
|
|
VP8LFillBitWindow(br); |
|
|
|
VP8LFillBitWindow(br); |
|
|
|
dist_code = GetCopyDistance(dist_symbol, br); |
|
|
|
dist_code = GetCopyDistance(dist_symbol, br); |
|
|
|
dist = PlaneCodeToDistance(width, dist_code); |
|
|
|
dist = PlaneCodeToDistance(width, dist_code); |
|
|
|
|
|
|
|
|
|
|
|
if (VP8LIsEndOfStream(br)) break; |
|
|
|
if (VP8LIsEndOfStream(br)) break; |
|
|
|
if (src - data < (ptrdiff_t)dist || src_end - src < (ptrdiff_t)length) { |
|
|
|
if (src - data < (ptrdiff_t)dist || src_end - src < (ptrdiff_t)length) { |
|
|
|
goto Error; |
|
|
|
goto Error; |
|
|
@ -1553,7 +1553,7 @@ static void ExtractAlphaRows(VP8LDecoder* const dec, int last_row) { |
|
|
|
const int cache_pixs = width * num_rows_to_process; |
|
|
|
const int cache_pixs = width * num_rows_to_process; |
|
|
|
uint8_t* const dst = output + width * cur_row; |
|
|
|
uint8_t* const dst = output + width * cur_row; |
|
|
|
const uint32_t* const src = dec->argb_cache_; |
|
|
|
const uint32_t* const src = dec->argb_cache_; |
|
|
|
ApplyInverseTransforms(dec, num_rows_to_process, in); |
|
|
|
ApplyInverseTransforms(dec, cur_row, num_rows_to_process, in); |
|
|
|
WebPExtractGreen(src, dst, cache_pixs); |
|
|
|
WebPExtractGreen(src, dst, cache_pixs); |
|
|
|
AlphaApplyFilter(alph_dec, |
|
|
|
AlphaApplyFilter(alph_dec, |
|
|
|
cur_row, cur_row + num_rows_to_process, dst, width); |
|
|
|
cur_row, cur_row + num_rows_to_process, dst, width); |
|
|
|