summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_encode_h264.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/vaapi_encode_h264.c')
-rw-r--r--libavcodec/vaapi_encode_h264.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 8690a8565b..4802929f93 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -1,18 +1,18 @@
/*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -731,6 +731,12 @@ static av_cold int vaapi_encode_h264_init_constant_bitrate(AVCodecContext *avctx
int hrd_buffer_size;
int hrd_initial_buffer_fullness;
+ if (avctx->bit_rate > INT32_MAX) {
+ av_log(avctx, AV_LOG_ERROR, "Target bitrate of 2^31 bps or "
+ "higher is not supported.\n");
+ return AVERROR(EINVAL);
+ }
+
if (avctx->rc_buffer_size)
hrd_buffer_size = avctx->rc_buffer_size;
else
@@ -769,7 +775,7 @@ static av_cold int vaapi_encode_h264_init_constant_bitrate(AVCodecContext *avctx
priv->fixed_qp_p = 26;
priv->fixed_qp_b = 26;
- av_log(avctx, AV_LOG_DEBUG, "Using constant-bitrate = %d bps.\n",
+ av_log(avctx, AV_LOG_DEBUG, "Using constant-bitrate = %"PRId64" bps.\n",
avctx->bit_rate);
return 0;
}