aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>2019-08-10 14:40:23 +0200
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2019-08-10 23:27:58 +0200
commit57987deefcdc779258c61f5b288ce590b36f8234 (patch)
tree4d570196e6d54a8788b8567cdb76a3a58d6c7598 /libavcodec/libx264.c
parentc29d81e73641d0f58e6f058a095e18b99769dac1 (diff)
downloadffmpeg-57987deefcdc779258c61f5b288ce590b36f8234.tar.gz
lavc/libx264: bit_rates > INT_MAX are not supported.
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index dc4b4b100d..01f9455e20 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -594,6 +594,10 @@ static av_cold int X264_init(AVCodecContext *avctx)
PARSE_X264_OPT("weightp", wpredp);
if (avctx->bit_rate) {
+ if (avctx->bit_rate / 1000 > INT_MAX || avctx->rc_max_rate / 1000 > INT_MAX) {
+ av_log(avctx, AV_LOG_ERROR, "bit_rate and rc_max_rate > %d000 not supported by libx264\n", INT_MAX);
+ return AVERROR(EINVAL);
+ }
x4->params.rc.i_bitrate = avctx->bit_rate / 1000;
x4->params.rc.i_rc_method = X264_RC_ABR;
}