Commit 3623589e authored by Anton Khirnov's avatar Anton Khirnov

dfa: check for invalid access in decode_wdlt().

This can happen when the number of skipped lines is not consistent with
the number of coded lines.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
parent dbb14258
...@@ -255,6 +255,8 @@ static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height ...@@ -255,6 +255,8 @@ static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height
segments = bytestream2_get_le16(gb); segments = bytestream2_get_le16(gb);
} }
line_ptr = frame; line_ptr = frame;
if (frame_end - frame < width)
return AVERROR_INVALIDDATA;
frame += width; frame += width;
y++; y++;
while (segments--) { while (segments--) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment