[FFmpeg-cvslog] libvpxenc: check for odd RC parameter combinations that could crash

Michael Niedermayer git at videolan.org
Thu Aug 16 17:04:19 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Aug 16 16:59:42 2012 +0200| [75cd9a62f4af4d4fa46e0818269efeb88b9c9938] | committer: Michael Niedermayer

libvpxenc: check for odd RC parameter combinations that could crash

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=75cd9a62f4af4d4fa46e0818269efeb88b9c9938
---

 libavcodec/libvpxenc.c |    7 +++++++
 1 file changed, 7 insertions(+)

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;



More information about the ffmpeg-cvslog mailing list