Commit 796012af authored by Michael Niedermayer's avatar Michael Niedermayer

targa: Fix y check in advance_line

Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f43d09cd
......@@ -40,7 +40,7 @@ static uint8_t *advance_line(uint8_t *start, uint8_t *line,
return line + interleave * stride;
} else {
*y = (*y + 1) & (interleave - 1);
if (*y) {
if (*y && *y < h) {
return start + *y * stride;
} else {
return NULL;
......
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