summaryrefslogtreecommitdiffstats
path: root/libavcodec/targa.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-09 20:49:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-09 21:21:26 +0100
commit796012af6c780b5b13ebca39a491f215515a18fe (patch)
tree38072ae21951f84e90e6a9b68bf9eccc8fc939b4 /libavcodec/targa.c
parentf43d09cd60a17a139b3aeb94434dbbbac1a28dab (diff)
downloadffmpeg-streaming-796012af6c780b5b13ebca39a491f215515a18fe.zip
ffmpeg-streaming-796012af6c780b5b13ebca39a491f215515a18fe.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>
Diffstat (limited to 'libavcodec/targa.c')
-rw-r--r--libavcodec/targa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/targa.c b/libavcodec/targa.c
index 11a8f21..2d1d3df 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;
OpenPOWER on IntegriCloud