summaryrefslogtreecommitdiff
path: root/libavformat/mpegenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-29 17:02:57 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-29 17:02:57 +0200
commitf2eb474a5a3d0ff1f1c5fbdfb8e9a1abe5661bce (patch)
tree0685570d18d32ddda27520f266d62a3ce4f8d724 /libavformat/mpegenc.c
parent8c1253c9349cd68dfcf95298cef5e42f3be7dc14 (diff)
avformat/mpegenc: check, warn and clip muxrate to syntactical possible values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegenc.c')
-rw-r--r--libavformat/mpegenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 6e94f9dab4..0a9d69b344 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -428,6 +428,10 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
bitrate += bitrate / 20;
bitrate += 10000;
s->mux_rate = (bitrate + (8 * 50) - 1) / (8 * 50);
+ if (s->mux_rate >= (1<<22)) {
+ av_log(ctx, AV_LOG_WARNING, "mux rate %d is too large\n", s->mux_rate);
+ s->mux_rate = (1<<22) - 1;
+ }
}
if (s->is_vcd) {