aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-11 22:13:42 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-21 17:02:12 +0200
commit7734c583f777fdba2f6463cf525385ebe5cf10db (patch)
treec263bdb0e827db06619373ec66a1c6badaaa8acb
parentbe30913538d4be9a50672ceb683f8745d8aa75a9 (diff)
downloadffmpeg-7734c583f777fdba2f6463cf525385ebe5cf10db.tar.gz
avformat/webpenc: Check filesize in trailer
not sure this is possible Fixes: CID1604446 Overflowed constant Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/webpenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c
index 1c5b93e0ab..ce0d046aa9 100644
--- a/libavformat/webpenc.c
+++ b/libavformat/webpenc.c
@@ -190,7 +190,7 @@ static int webp_write_trailer(AVFormatContext *s)
if (!ret) {
filesize = avio_tell(s->pb);
- if (avio_seek(s->pb, 4, SEEK_SET) == 4) {
+ if (filesize >= 8 && avio_seek(s->pb, 4, SEEK_SET) == 4) {
avio_wl32(s->pb, filesize - 8);
// Note: without the following, avio only writes 8 bytes to the file.
avio_seek(s->pb, filesize, SEEK_SET);