summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libwebp/src/demux/demux.c
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-04-07 15:22:06 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-04-07 15:22:06 +0300
commit8c5bcabbf6a2e27539c2ad689fd69f2406d5cf5c (patch)
treec94914f103305661850b45164cda5d7313c301e5 /src/3rdparty/libwebp/src/demux/demux.c
parent90038c936763645610fe1e5f05cfc025e4d98631 (diff)
parent40da7331d6d818ec96604feaf978c8e6e828da7f (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.4' into tqtc/lts-5.15-opensourcev5.15.4-lts-lgpl
Diffstat (limited to 'src/3rdparty/libwebp/src/demux/demux.c')
-rw-r--r--src/3rdparty/libwebp/src/demux/demux.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/3rdparty/libwebp/src/demux/demux.c b/src/3rdparty/libwebp/src/demux/demux.c
index 1b3cc2e..860e2ce 100644
--- a/src/3rdparty/libwebp/src/demux/demux.c
+++ b/src/3rdparty/libwebp/src/demux/demux.c
@@ -24,7 +24,7 @@
#include "src/webp/format_constants.h"
#define DMUX_MAJ_VERSION 1
-#define DMUX_MIN_VERSION 1
+#define DMUX_MIN_VERSION 2
#define DMUX_REV_VERSION 0
typedef struct {
@@ -312,6 +312,7 @@ static ParseStatus ParseAnimationFrame(
int bits;
MemBuffer* const mem = &dmux->mem_;
Frame* frame;
+ size_t start_offset;
ParseStatus status =
NewFrame(mem, ANMF_CHUNK_SIZE, frame_chunk_size, &frame);
if (status != PARSE_OK) return status;
@@ -332,7 +333,11 @@ static ParseStatus ParseAnimationFrame(
// Store a frame only if the animation flag is set there is some data for
// this frame is available.
+ start_offset = mem->start_;
status = StoreFrame(dmux->num_frames_ + 1, anmf_payload_size, mem, frame);
+ if (status != PARSE_ERROR && mem->start_ - start_offset > anmf_payload_size) {
+ status = PARSE_ERROR;
+ }
if (status != PARSE_ERROR && is_animation && frame->frame_num_ > 0) {
added_frame = AddFrame(dmux, frame);
if (added_frame) {