aboutsummaryrefslogtreecommitdiffstats
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-15 17:39:04 +0100
commit2111d5161926cef343031efcaf09662afb14db25 (patch)
tree3889ca230dc6947599b4eae3526bc379f03da4a0 /libavcodec
parent53025e8681c141883662ab9882ac2f7769c6ed4d (diff)
downloadffmpeg-2111d5161926cef343031efcaf09662afb14db25.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>
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 9b95f33976..6b997f121f 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -315,6 +315,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;