summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-12-27 20:00:10 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-12-28 10:24:15 +0100
commit50401f5fb7d778583b03a13bc4440f71063d319d (patch)
tree7c1f8595fe83e184a2f2328f1076f8c26b28fed0 /libavcodec/utils.c
parent3c6781b48acd4eda5f0c5edbdcb547477312d684 (diff)
avcodec: properly check pkt_timebase for validity
Unset/invalid timebases have a zero numerator. This makes the checks consistent with other timebase checks and fixes an integer division by 0.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 19f3f0ac12..33295ed270 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2435,7 +2435,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
} else {
avctx->internal->pkt = &pkt_recoded;
- if (avctx->pkt_timebase.den && avpkt->pts != AV_NOPTS_VALUE)
+ if (avctx->pkt_timebase.num && avpkt->pts != AV_NOPTS_VALUE)
sub->pts = av_rescale_q(avpkt->pts,
avctx->pkt_timebase, AV_TIME_BASE_Q);
ret = avctx->codec->decode(avctx, sub, got_sub_ptr, &pkt_recoded);