aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-28 18:41:01 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-28 18:41:01 +0100
commitddd86a2924b9bc67c406cd66ebb1fc8915cd60f7 (patch)
tree393fad51749d65809932912d9277fb6c381dbe48 /ffmpeg.c
parent539a8469ae77cae0018409408457b9da2fd5a170 (diff)
downloadffmpeg-ddd86a2924b9bc67c406cd66ebb1fc8915cd60f7.tar.gz
ffmpeg: Fix division by 0 due to invalid timebase
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 4bdca88c7a..06fb2535a9 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2269,7 +2269,7 @@ static int output_packet(InputStream *ist,
ret = transcode_video (ist, &avpkt, &got_output, &pkt_pts);
if (avpkt.duration) {
duration = av_rescale_q(avpkt.duration, ist->st->time_base, AV_TIME_BASE_Q);
- } else if(ist->st->codec->time_base.num != 0) {
+ } else if(ist->st->codec->time_base.num != 0 && ist->st->codec->time_base.den != 0) {
int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame;
duration = ((int64_t)AV_TIME_BASE *
ist->st->codec->time_base.num * ticks) /