]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Fix an exploit in indeo by checking we are not writing out of the strip array.
authorbenoit <benoit@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 26 Jan 2009 09:41:23 +0000 (09:41 +0000)
committerbenoit <benoit@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 26 Jan 2009 09:41:23 +0000 (09:41 +0000)
Fixes issue 655

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16802 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/indeo3.c

index eea27f927cd5e0b03219ddea985986beddbf75c7..d041be75eec2853153cb160f894bf8140e624c08 100644 (file)
@@ -252,6 +252,10 @@ static void iv_Decode_Chunk(Indeo3DecodeContext *s,
 
         if(cmd == 0) {
             strip++;
+            if(strip >= strip_tbl + FF_ARRAY_ELEMS(strip_tbl)) {
+                av_log(s->avctx, AV_LOG_WARNING, "out of range strip\n");
+                break;
+            }
             memcpy(strip, strip-1, sizeof(*strip));
             strip->split_flag = 1;
             strip->split_direction = 0;
@@ -259,6 +263,10 @@ static void iv_Decode_Chunk(Indeo3DecodeContext *s,
             continue;
         } else if(cmd == 1) {
             strip++;
+            if(strip >= strip_tbl + FF_ARRAY_ELEMS(strip_tbl)) {
+                av_log(s->avctx, AV_LOG_WARNING, "out of range strip\n");
+                break;
+            }
             memcpy(strip, strip-1, sizeof(*strip));
             strip->split_flag = 1;
             strip->split_direction = 1;