[FFmpeg-cvslog] dfa: Fix out of array write in decode_dds1()

Michael Niedermayer git at videolan.org
Fri Apr 13 23:15:30 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Apr 13 22:57:23 2012 +0200| [72b9537d8886f679494651df517dfed9b420cf1f] | committer: Michael Niedermayer

dfa: Fix out of array write in decode_dds1()

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=72b9537d8886f679494651df517dfed9b420cf1f
---

 libavcodec/dfa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
index 13637d6..9664b47 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -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);



More information about the ffmpeg-cvslog mailing list