[FFmpeg-cvslog] libavcodec/util: Fix timebase overflow check

Derek Buitenhuis git at videolan.org
Wed Jan 27 23:01:34 CET 2016


ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Wed Jan 27 21:12:04 2016 +0000| [265ed6732fbde8a4082b2ba71fe3cd623f649bab] | committer: Derek Buitenhuis

libavcodec/util: Fix timebase overflow check

It could accidentally divide by zero if num was zero.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=265ed6732fbde8a4082b2ba71fe3cd623f649bab
---

 libavcodec/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 13ee243..491d8ea 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1475,7 +1475,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
         if (!avctx->rc_initial_buffer_occupancy)
             avctx->rc_initial_buffer_occupancy = avctx->rc_buffer_size * 3 / 4;
 
-        if (avctx->ticks_per_frame &&
+        if (avctx->ticks_per_frame && avctx->time_base.num &&
             avctx->ticks_per_frame > INT_MAX / avctx->time_base.num) {
             av_log(avctx, AV_LOG_ERROR,
                    "ticks_per_frame %d too large for the timebase %d/%d.",



More information about the ffmpeg-cvslog mailing list