summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-01-07 00:22:56 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-07 00:41:21 +0100
commit13f266b50cc7554028d22480b7e4383968e64a63 (patch)
tree21823071b85d64b987a443057b077418ad36243e /libavcodec
parent3ec5d8fe0ff11ceaca6326234af43a4486487be7 (diff)
avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range
Fixes out of array read Fixes: test_case-mdc.264 (b47be15a120979f5a1a945c938cbef33) Found-by: Tyson Smith <twsmith@mozilla.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo_enc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 3476543e99..89ab1c3edc 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -347,6 +347,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
break;
}
+ avctx->bits_per_raw_sample = av_clip(avctx->bits_per_raw_sample, 0, 8);
s->bit_rate = avctx->bit_rate;
s->width = avctx->width;
s->height = avctx->height;