Browse Source

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>
tags/n1.2
Michael Niedermayer 13 years ago
parent
commit
796012af6c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/targa.c

+ 1
- 1
libavcodec/targa.c 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;


Loading…
Cancel
Save