From 77693c541a541661357a0edd5bbaae69c64b2039 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 1 Dec 2012 23:20:48 +0100 Subject: xxan: more complete ybuf checks, fix out of array accesses. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/xxan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libavcodec/xxan.c') diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c index 2c33f07..47b3544 100644 --- a/libavcodec/xxan.c +++ b/libavcodec/xxan.c @@ -276,7 +276,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; @@ -350,7 +351,8 @@ static int xan_decode_frame_type1(AVCodecContext *avctx) ybuf[j+1] = cur; last = cur; } - ybuf[j] = last; + if(j < avctx->width) + ybuf[j] = last; ybuf += avctx->width; } -- cgit v1.1