mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 21:20:41 +00:00
r3d: fix division by 0 with 0 sample rate
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3cd9849d9c
commit
df92ac1852
@ -312,7 +312,8 @@ static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
|
||||
|
||||
pkt->stream_index = 1;
|
||||
pkt->dts = dts;
|
||||
pkt->duration = av_rescale(samples, st->time_base.den, st->codec->sample_rate);
|
||||
if (st->codec->sample_rate)
|
||||
pkt->duration = av_rescale(samples, st->time_base.den, st->codec->sample_rate);
|
||||
av_dlog(s, "pkt dts %"PRId64" duration %d samples %d sample rate %d\n",
|
||||
pkt->dts, pkt->duration, samples, st->codec->sample_rate);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user