[FFmpeg-cvslog] xxan: check ybuf index before use.
Michael Niedermayer
git at videolan.org
Sat Nov 17 04:50:39 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 17 04:45:38 2012 +0100| [8ad9b48c9b5b749df8fbcd59d61278caadc478ca] | committer: Michael Niedermayer
xxan: check ybuf index before use.
Fixes out of array access
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=8ad9b48c9b5b749df8fbcd59d61278caadc478ca
---
libavcodec/xxan.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c
index de1ea7f..2c33f07 100644
--- a/libavcodec/xxan.c
+++ b/libavcodec/xxan.c
@@ -289,7 +289,8 @@ static int xan_decode_frame_type0(AVCodecContext *avctx)
ybuf[j+1] = cur << 1;
last = cur;
}
- ybuf[j] = last << 1;
+ if(j < avctx->width)
+ ybuf[j] = last << 1;
prev_buf = ybuf;
ybuf += avctx->width;
}
More information about the ffmpeg-cvslog
mailing list