Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-29 19:57:22 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-01-29 19:57:50 +0400
commitdf92ac18528bac4566fc4f5ba4d607c1265791ea (patch)
treee1ee69fafd1144abd25ad07ab734344132058f63 /libavformat/r3d.c
parent3cd9849d9c24b0808e6e55cd7568250acaae2b91 (diff)
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>
Diffstat (limited to 'libavformat/r3d.c')
-rw-r--r--libavformat/r3d.c3
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);