From 72b9537d8886f679494651df517dfed9b420cf1f Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 13 Apr 2012 22:57:23 +0200 Subject: [PATCH] dfa: Fix out of array write in decode_dds1() Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/dfa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 13637d6a05..9664b47d4f 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);