Fixes: CID1608714 Division or modulo by float zero
Unified · Split
| @@ -585,7 +585,7 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp, · 584 unmodified lines | ||
| 585 | 585 | if (best_pos < 0) |
| 586 | 586 | return best_pos; |
| 587 | 587 | |
| 588 | − if (mp3->is_cbr && ie == &ie1 && mp3->frames) { | |
| 588 | + if (mp3->is_cbr && ie == &ie1 && mp3->frames && mp3->header_filesize > 0) { | |
| 589 | 589 | int frame_duration = av_rescale(st->duration, 1, mp3->frames); |
| 590 | 590 | ie1.timestamp = frame_duration * av_rescale(best_pos - si->data_offset, mp3->frames, mp3->header_filesize); |
| 591 | 591 | } |