mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
libvpxenc: check for odd RC parameter combinations that could crash
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d472453efd
commit
75cd9a62f4
@ -242,6 +242,13 @@ static av_cold int vp8_init(AVCodecContext *avctx)
|
|||||||
vpx_codec_err_to_string(res));
|
vpx_codec_err_to_string(res));
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!avctx->bit_rate)
|
||||||
|
if(avctx->rc_max_rate || avctx->rc_buffer_size || avctx->rc_initial_buffer_occupancy) {
|
||||||
|
av_log( avctx, AV_LOG_ERROR, "Rate control parameters set without a bitrate\n");
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
dump_enc_cfg(avctx, &enccfg);
|
dump_enc_cfg(avctx, &enccfg);
|
||||||
|
|
||||||
enccfg.g_w = avctx->width;
|
enccfg.g_w = avctx->width;
|
||||||
|
Loading…
Reference in New Issue
Block a user