mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
vaapi_encode_h26[45]: Reject bitrate targets higher than 2^31
This commit is contained in:
parent
056a4ae771
commit
d4cd8e7f6a
@ -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
|
||||
|
@ -1158,6 +1158,12 @@ static av_cold int vaapi_encode_h265_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
|
||||
|
Loading…
Reference in New Issue
Block a user