diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-29 16:57:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-29 16:57:50 +0100 |
commit | df92ac18528bac4566fc4f5ba4d607c1265791ea (patch) | |
tree | e1ee69fafd1144abd25ad07ab734344132058f63 | |
parent | 3cd9849d9c24b0808e6e55cd7568250acaae2b91 (diff) | |
download | ffmpeg-df92ac18528bac4566fc4f5ba4d607c1265791ea.tar.gz |
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>
-rw-r--r-- | libavformat/r3d.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/r3d.c b/libavformat/r3d.c index 35da81eff1..5ee0b93686 100644 --- a/libavformat/r3d.c +++ b/libavformat/r3d.c @@ -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); |