diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-09 20:49:32 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-19 01:28:24 +0100 |
commit | f5955d9f6f9ffdb81864c3de1c7b801782a55725 (patch) | |
tree | 6aef8729fc92991bf18388cc237bab6e9ac41bf0 | |
parent | e14564b9262d072057b52b2a85c974525580aee0 (diff) | |
download | ffmpeg-f5955d9f6f9ffdb81864c3de1c7b801782a55725.tar.gz |
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>
(cherry picked from commit 796012af6c780b5b13ebca39a491f215515a18fe)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/targa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/targa.c b/libavcodec/targa.c index 6bb05a93ad..321441cb08 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -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; |