dfa: fix out of array write in decode_wdlt()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Apr 2012 20:52:16 +0000 (22:52 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Apr 2012 20:58:54 +0000 (22:58 +0200)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dfa.c

index d8516b2..13637d6 100644 (file)
@@ -242,6 +242,8 @@ static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height
             frame    += delta;
             segments = bytestream2_get_le16(gb);
         }
+        if (frame_end <= frame)
+            return -1;
         if (segments & 0x8000) {
             frame[width - 1] = segments & 0xFF;
             segments = bytestream2_get_le16(gb);