History

avformat/mp3dec: Check header_filesize

Fixes: CID1608714 Division or modulo by float zero

Michael Niedermayer committed 2 years ago

Commit cea4dbc1 parent bb936a11 file · +1 −1Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/mp3dec.c+1−1
@@ -585,7 +585,7 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp, · 584 unmodified lines
585585 if (best_pos < 0)
586586 return best_pos;
587587
588− if (mp3->is_cbr && ie == &ie1 && mp3->frames) {
588+ if (mp3->is_cbr && ie == &ie1 && mp3->frames && mp3->header_filesize > 0) {
589589 int frame_duration = av_rescale(st->duration, 1, mp3->frames);
590590 ie1.timestamp = frame_duration * av_rescale(best_pos - si->data_offset, mp3->frames, mp3->header_filesize);
591591 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t