Unverified Commit 759aae59 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avformat/sauce: Check avio_size() for failure


Fixes: CID1604592 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 3e305a0e
Showing with 6 additions and 1 deletion
+6 -1
......@@ -34,7 +34,12 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g
AVIOContext *pb = avctx->pb;
char buf[36];
int datatype, filetype, t1, t2, nb_comments;
uint64_t start_pos = avio_size(pb) - 128;
int64_t start_pos = avio_size(pb);
if (start_pos < 128)
return AVERROR_INVALIDDATA;
start_pos -= 128;
avio_seek(pb, start_pos, SEEK_SET);
if (avio_read(pb, buf, 7) != 7)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment