[FFmpeg-cvslog] targa: Fix y check in advance_line
Michael Niedermayer
git at videolan.org
Tue Feb 19 01:35:45 CET 2013
ffmpeg | branch: release/1.1 | Michael Niedermayer <michaelni at gmx.at> | Sat Feb 9 20:49:32 2013 +0100| [f5955d9f6f9ffdb81864c3de1c7b801782a55725] | committer: 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: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 796012af6c780b5b13ebca39a491f215515a18fe)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f5955d9f6f9ffdb81864c3de1c7b801782a55725
---
libavcodec/targa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/targa.c b/libavcodec/targa.c
index 6bb05a9..321441c 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;
More information about the ffmpeg-cvslog
mailing list