Commit 6c33c969b4 for ffmpeg
commit 6c33c969b4494b9d32e8f0527c87d6c034701cbb
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Fri Sep 25 05:58:26 2026 +0200
avformat/webpenc: require the VP8X flags byte to be within the packet
Fixes: out of array read
Fixes: twp2aA6PnymU
Found-by: Mohamed K. Fathy <sirmatrixpage@gmail.com>
diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c
index 88e35a315b..f3c70d62c5 100644
--- a/libavformat/webpenc.c
+++ b/libavformat/webpenc.c
@@ -60,6 +60,8 @@ static int is_animated_webp_packet(AVPacket *pkt)
if (pkt->size < skip + 4)
return AVERROR_INVALIDDATA;
if (AV_RL32(pkt->data + skip) == AV_RL32("VP8X")) {
+ if (pkt->size < skip + 9)
+ return AVERROR_INVALIDDATA;
flags |= pkt->data[skip + 4 + 4];
}