[FFmpeg-cvslog] pcx: Add missing padding to scanline buffer

Michael Niedermayer git at videolan.org
Sun Feb 10 17:33:07 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 10 17:19:35 2013 +0100| [d24de4596c3f980c9cc1cb5c8706c8411e46275b] | committer: Michael Niedermayer

pcx: Add missing padding to scanline buffer

Fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c
index d21639e..e7f9c24 100644
--- a/libavcodec/pcx.c
+++ b/libavcodec/pcx.c
@@ -161,7 +161,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     ptr    = p->data[0];
     stride = p->linesize[0];
 
-    scanline = av_malloc(bytes_per_scanline);
+    scanline = av_malloc(bytes_per_scanline + FF_INPUT_BUFFER_PADDING_SIZE);
     if (!scanline)
         return AVERROR(ENOMEM);
 



More information about the ffmpeg-cvslog mailing list