Commit 13f266b5 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range

Fixes out of array read
Fixes: test_case-mdc.264 (b47be15a120979f5a1a945c938cbef33)
Found-by: 's avatarTyson Smith <twsmith@mozilla.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 3ec5d8fe
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment