diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-10-30 21:18:20 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-11-17 23:12:09 +0100 |
commit | 6e5ccabbe8461f5bde1c8ad87a2ced343fd2e5b7 (patch) | |
tree | 7b67a5479e5b4f8f174faee9edd251f7ea0a3267 | |
parent | 266cf258cc9377fa46acf78dfcb354b4cb12ef6f (diff) | |
download | ffmpeg-6e5ccabbe8461f5bde1c8ad87a2ced343fd2e5b7.tar.gz |
interplayacm: increase bitstream buffer size by AV_INPUT_BUFFER_PADDING_SIZE
This fixes out-of-bounds reads by the bitstream reader.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 60178e78f2fe9a7bfb9da0abc985835e2ebfd2f1)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r-- | libavcodec/interplayacm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/interplayacm.c b/libavcodec/interplayacm.c index 032053103a..c897e72bb6 100644 --- a/libavcodec/interplayacm.c +++ b/libavcodec/interplayacm.c @@ -77,7 +77,7 @@ static av_cold int decode_init(AVCodecContext *avctx) s->block = av_calloc(s->block_len, sizeof(int)); s->wrapbuf = av_calloc(s->wrapbuf_len, sizeof(int)); s->ampbuf = av_calloc(0x10000, sizeof(int)); - s->bitstream = av_calloc(s->max_framesize, sizeof(*s->bitstream)); + s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE / sizeof(*s->bitstream) + 1, sizeof(*s->bitstream)); if (!s->block || !s->wrapbuf || !s->ampbuf || !s->bitstream) return AVERROR(ENOMEM); |