diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-16 16:59:42 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-16 17:00:32 +0200 |
commit | 75cd9a62f4af4d4fa46e0818269efeb88b9c9938 (patch) | |
tree | 7e5fd5c095c22e9f206b81ea45d5c7b7601bfe21 /libavcodec/libvpxenc.c | |
parent | d472453efd32bfb0b3cd348183f4fcb7d4df4389 (diff) | |
download | ffmpeg-streaming-75cd9a62f4af4d4fa46e0818269efeb88b9c9938.zip ffmpeg-streaming-75cd9a62f4af4d4fa46e0818269efeb88b9c9938.tar.gz |
libvpxenc: check for odd RC parameter combinations that could crash
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libvpxenc.c')
-rw-r--r-- | libavcodec/libvpxenc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 7046802..0b97907 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -242,6 +242,13 @@ static av_cold int vp8_init(AVCodecContext *avctx) vpx_codec_err_to_string(res)); 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); enccfg.g_w = avctx->width; |