OSDN Git Service

dfa: Fix out of array write in decode_dds1()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Apr 2012 20:57:23 +0000 (22:57 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Apr 2012 20:59:33 +0000 (22:59 +0200)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dfa.c

index 13637d6..9664b47 100644 (file)
@@ -149,7 +149,7 @@ static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height
             bitbuf = bytestream2_get_le16u(gb);
             mask = 1;
         }
-        if (frame_end - frame < 2)
+        if (frame_end - frame < width + 2)
             return -1;
         if (bitbuf & mask) {
             v = bytestream2_get_le16(gb);