aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dfa.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-13 22:52:16 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-13 22:58:54 +0200
commitd1c95d2ce39560e251fdb14f4af91b04fd7b845c (patch)
tree20571824c92d39433d84bdef2b5127584d874da8 /libavcodec/dfa.c
parent367d9b2957fa455b59f131fd6bee896cb7ed6600 (diff)
downloadffmpeg-d1c95d2ce39560e251fdb14f4af91b04fd7b845c.tar.gz
dfa: fix out of array write in decode_wdlt()
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dfa.c')
-rw-r--r--libavcodec/dfa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
index d8516b2f50..13637d6a05 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -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);