diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-17 04:45:38 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-17 04:45:56 +0100 |
commit | 8ad9b48c9b5b749df8fbcd59d61278caadc478ca (patch) | |
tree | c178bc4f9a1888ba76debc9d00750adebed5204a /libavcodec/xxan.c | |
parent | 774830050aff71bcf02c68c0767f401240385842 (diff) | |
download | ffmpeg-8ad9b48c9b5b749df8fbcd59d61278caadc478ca.tar.gz |
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@gmx.at>
Diffstat (limited to 'libavcodec/xxan.c')
-rw-r--r-- | libavcodec/xxan.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c index de1ea7f0e4..2c33f07a71 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; } |