[FFmpeg-cvslog] avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range

Michael Niedermayer git at videolan.org
Fri Jan 15 16:37:56 CET 2016


ffmpeg | branch: release/2.7 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jan  7 00:22:56 2016 +0100| [3dd0d43d8cf7970a141c8f76fa8ec3d81d65be82] | committer: 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: Tyson Smith <twsmith at mozilla.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 13f266b50cc7554028d22480b7e4383968e64a63)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3dd0d43d8cf7970a141c8f76fa8ec3d81d65be82
---

 libavcodec/mpegvideo_enc.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index edebc9d..0cf138e 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;



More information about the ffmpeg-cvslog mailing list