webpdec: correct alloc size check w/use_argb

the allocation is always 4 x width regardless of the presence of alpha

Change-Id: I154bd7e5c0190d37abd669e17e18911ebb7e066c
This commit is contained in:
James Zern 2017-10-27 06:09:36 +00:00
parent 5cfb3b0f6c
commit 6ba98764e8

View File

@ -145,7 +145,7 @@ int ReadWebP(const uint8_t* const data, size_t data_size,
pic->width = bitstream->width; pic->width = bitstream->width;
pic->height = bitstream->height; pic->height = bitstream->height;
if (pic->use_argb) { if (pic->use_argb) {
stride = (uint64_t)bitstream->width * (has_alpha ? 4 : 3); stride = (uint64_t)bitstream->width * 4;
} else { } else {
stride = (uint64_t)bitstream->width * (has_alpha ? 5 : 3) / 2; stride = (uint64_t)bitstream->width * (has_alpha ? 5 : 3) / 2;
pic->colorspace = has_alpha ? WEBP_YUV420A : WEBP_YUV420; pic->colorspace = has_alpha ? WEBP_YUV420A : WEBP_YUV420;