diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-07 00:22:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-15 16:00:31 +0100 |
commit | 3dd0d43d8cf7970a141c8f76fa8ec3d81d65be82 (patch) | |
tree | 79efaf3cffa8924ea059db07f660a80dee84e39e | |
parent | 2f6d3459d9085472ddab243eaa1bf47aed3f130f (diff) | |
download | ffmpeg-3dd0d43d8cf7970a141c8f76fa8ec3d81d65be82.tar.gz |
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>
(cherry picked from commit 13f266b50cc7554028d22480b7e4383968e64a63)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index edebc9d340..0cf138e217 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -317,6 +317,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; |