diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2020-06-08 19:51:33 +0800 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2020-06-19 07:14:46 +0800 |
commit | e3b5897fe3f1b76b4d46bab452cd35a7f308a93a (patch) | |
tree | 8d35b628572196825fb830ecc7ff283d9888417f /libavcodec/libx265.c | |
parent | 93016f5d1d280f9cb7856883af287fa66affc04c (diff) |
avcodec/libx265: Fix integer overflow in computation of max and avg bitrate
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavcodec/libx265.c')
-rw-r--r-- | libavcodec/libx265.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index f560d7f62f..686c205b6b 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -310,8 +310,8 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx) if (!cpb_props) return AVERROR(ENOMEM); cpb_props->buffer_size = ctx->params->rc.vbvBufferSize * 1000; - cpb_props->max_bitrate = ctx->params->rc.vbvMaxBitrate * 1000; - cpb_props->avg_bitrate = ctx->params->rc.bitrate * 1000; + cpb_props->max_bitrate = ctx->params->rc.vbvMaxBitrate * 1000LL; + cpb_props->avg_bitrate = ctx->params->rc.bitrate * 1000LL; if (!(avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER)) ctx->params->bRepeatHeaders = 1; |