summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka-at-google.com@ffmpeg.org>2017-08-20 11:56:47 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 03:17:11 +0200
commit8c2bb10ddfef1f151b9455d152c9aca91140a4b0 (patch)
treee0a174f0d7fef9de4d5cc60dd38120eaeba4a6a6 /libavcodec/utils.c
parentf3913dcc06854dbaf90890fa5853638e057b9bb1 (diff)
downloadffmpeg-8c2bb10ddfef1f151b9455d152c9aca91140a4b0.tar.gz
avcodec/utils: Fix signed integer overflow in rc_initial_buffer_occupancy initialization
Signed integer overflow is undefined behavior. Detected with clang and -fsanitize=signed-integer-overflow Signed-off-by: Vitaly Buka <vitalybuka@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
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 1336e921c9..1b8ad1d200 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -971,7 +971,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if (!avctx->rc_initial_buffer_occupancy)
- avctx->rc_initial_buffer_occupancy = avctx->rc_buffer_size * 3 / 4;
+ avctx->rc_initial_buffer_occupancy = avctx->rc_buffer_size * 3LL / 4;
if (avctx->ticks_per_frame && avctx->time_base.num &&
avctx->ticks_per_frame > INT_MAX / avctx->time_base.num) {