diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-04-07 15:22:06 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-04-07 15:22:06 +0300 |
commit | 8c5bcabbf6a2e27539c2ad689fd69f2406d5cf5c (patch) | |
tree | c94914f103305661850b45164cda5d7313c301e5 /src/3rdparty/libwebp/src/demux/anim_decode.c | |
parent | 90038c936763645610fe1e5f05cfc025e4d98631 (diff) | |
parent | 40da7331d6d818ec96604feaf978c8e6e828da7f (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.4' into tqtc/lts-5.15-opensourcev5.15.4-lts-lgpl
Change-Id: I0c8024a783a45e5369d64ac2ce0189f9d4b2899d
Diffstat (limited to 'src/3rdparty/libwebp/src/demux/anim_decode.c')
-rw-r--r-- | src/3rdparty/libwebp/src/demux/anim_decode.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/3rdparty/libwebp/src/demux/anim_decode.c b/src/3rdparty/libwebp/src/demux/anim_decode.c index 05dd707..3dcacc3 100644 --- a/src/3rdparty/libwebp/src/demux/anim_decode.c +++ b/src/3rdparty/libwebp/src/demux/anim_decode.c @@ -346,12 +346,15 @@ int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, { const uint8_t* in = iter.fragment.bytes; const size_t in_size = iter.fragment.size; - const size_t out_offset = - (iter.y_offset * width + iter.x_offset) * NUM_CHANNELS; + const uint32_t stride = width * NUM_CHANNELS; // at most 25 + 2 bits + const uint64_t out_offset = (uint64_t)iter.y_offset * stride + + (uint64_t)iter.x_offset * NUM_CHANNELS; // 53b + const uint64_t size = (uint64_t)iter.height * stride; // at most 25 + 27b WebPDecoderConfig* const config = &dec->config_; WebPRGBABuffer* const buf = &config->output.u.RGBA; - buf->stride = NUM_CHANNELS * width; - buf->size = buf->stride * iter.height; + if ((size_t)size != size) goto Error; + buf->stride = (int)stride; + buf->size = (size_t)size; buf->rgba = dec->curr_frame_ + out_offset; if (WebPDecode(in, in_size, config) != VP8_STATUS_OK) { |