summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 29ba85fd21..e06ee664b5 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1049,6 +1049,16 @@ 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 &&
+ 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.",
+ avctx->ticks_per_frame,
+ avctx->time_base.num,
+ avctx->time_base.den);
+ goto free_and_end;
+ }
}
if (avctx->codec->init && !(avctx->active_thread_type & FF_THREAD_FRAME)) {