1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

targa: Fix y check in advance_line

Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-02-09 20:49:32 +01:00
parent f43d09cd60
commit 796012af6c

View File

@ -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;