matroskadec: fix out of bounds write
authorRonald S. Bultje <rsbultje@gmail.com>
Fri, 14 Oct 2011 22:03:55 +0000 (00:03 +0200)
committerJanne Grunau <janne-libav@jannau.net>
Fri, 14 Oct 2011 22:13:21 +0000 (00:13 +0200)
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
libavformat/matroskadec.c

index 89df095cd8111b1826029ac91b9bc213b886c52d..237e9295e08a14cab631ad42dfecde19a53afa2d 100644 (file)
@@ -1783,7 +1783,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
                         lace_size[n] = lace_size[n - 1] + snum;
                         total += lace_size[n];
                     }
-                    lace_size[n] = size - total;
+                    lace_size[laces - 1] = size - total;
                     break;
                 }
             }