[FFmpeg-cvslog] imc: add required padding for GetBitContext buffer

Janne Grunau git at videolan.org
Thu Aug 20 14:29:31 CEST 2015


ffmpeg | branch: release/2.4 | Janne Grunau <janne-libav at jannau.net> | Mon Jun  8 14:48:54 2015 +0200| [aa3ec219e1a5cc0e96ddec6ea83312ec780448f5] | committer: Janne Grunau

imc: add required padding for GetBitContext buffer

Fixes stack buffer overflow errors detected by address sanitizer in
fate-imc.

CC: libav-stable at libav.org

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

 libavcodec/imc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 500f564..26fbcd4 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -997,7 +997,7 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
 
     IMCContext *q = avctx->priv_data;
 
-    LOCAL_ALIGNED_16(uint16_t, buf16, [IMC_BLOCK_SIZE / 2]);
+    LOCAL_ALIGNED_16(uint16_t, buf16, [(IMC_BLOCK_SIZE + FF_INPUT_BUFFER_PADDING_SIZE) / 2]);
 
     if (buf_size < IMC_BLOCK_SIZE * avctx->channels) {
         av_log(avctx, AV_LOG_ERROR, "frame too small!\n");



More information about the ffmpeg-cvslog mailing list