diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-07-11 20:17:00 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-07-21 16:41:37 +0200 |
commit | bb936a1a720856a51c48bf907475daa8065920c9 (patch) | |
tree | a182dc3587e3e789ed500d0844589dcdc6bd0275 | |
parent | 046d069552f5c2824f36fcf95d409670208dc94b (diff) | |
download | ffmpeg-bb936a1a720856a51c48bf907475daa8065920c9.tar.gz |
avformat/mp3dec; Check for avio_size() failure
Fixes: CID1608710 Improper use of negative value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mp3dec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index f421e03926..6443b80596 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -137,9 +137,10 @@ static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration int fill_index = (mp3->usetoc || fast_seek) && duration > 0; if (!filesize && - !(filesize = avio_size(s->pb))) { + (filesize = avio_size(s->pb)) <= 0) { av_log(s, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n"); fill_index = 0; + filesize = 0; } for (i = 0; i < XING_TOC_COUNT; i++) { |