mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 00:02:52 +00:00
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>
This commit is contained in:
parent
be30913538
commit
7734c583f7
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user