[FFmpeg-cvslog] xxan: more complete ybuf checks, fix out of array accesses.

Michael Niedermayer git at videolan.org
Sun Dec 2 00:52:27 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec  1 23:20:48 2012 +0100| [77693c541a541661357a0edd5bbaae69c64b2039] | committer: Michael Niedermayer

xxan: more complete ybuf checks, fix out of array accesses.

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=77693c541a541661357a0edd5bbaae69c64b2039
---

 libavcodec/xxan.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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;
     }
 



More information about the ffmpeg-cvslog mailing list