diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-07-11 20:20:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-07-21 16:41:41 +0200 |
commit | cea4dbc903eaf8cb7a4ea53b281deff495ff8fa0 (patch) | |
tree | 2746483185d9e1fb52c950c376e698db6341ba57 | |
parent | bb936a1a720856a51c48bf907475daa8065920c9 (diff) | |
download | ffmpeg-cea4dbc903eaf8cb7a4ea53b281deff495ff8fa0.tar.gz |
avformat/mp3dec: Check header_filesize
Fixes: CID1608714 Division or modulo by float zero
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mp3dec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 6443b80596..0029ba63aa 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -585,7 +585,7 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp, if (best_pos < 0) return best_pos; - if (mp3->is_cbr && ie == &ie1 && mp3->frames) { + if (mp3->is_cbr && ie == &ie1 && mp3->frames && mp3->header_filesize > 0) { int frame_duration = av_rescale(st->duration, 1, mp3->frames); ie1.timestamp = frame_duration * av_rescale(best_pos - si->data_offset, mp3->frames, mp3->header_filesize); } |