1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
(cherry picked from commit cea4dbc903)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-07-11 20:20:53 +02:00
parent a3b4e8156c
commit 617c635d04
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -592,7 +592,7 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
if (best_pos < 0) if (best_pos < 0)
return best_pos; 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); 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); ie1.timestamp = frame_duration * av_rescale(best_pos - si->data_offset, mp3->frames, mp3->header_filesize);
} }