diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-19 15:53:31 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-07 09:43:57 +0100 |
commit | 2c3114158510d05346e362d381a3b352175e260e (patch) | |
tree | 6a9e569a5cf2cc46a6410ff8a0bea53e80868010 | |
parent | ff8837e9c60a99172565c47d7fcf432418c0dac8 (diff) | |
download | ffmpeg-2c3114158510d05346e362d381a3b352175e260e.tar.gz |
qpeg: Add checks for running out of rows in qpeg_decode_inter
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 7a5a55722749a3ab77941914707277b147322cbe)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 4d90550cf95eac0451465116d6e53bac37b96927)
-rw-r--r-- | libavcodec/qpeg.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 9513dd0ad3..9897f16bf3 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -198,6 +198,8 @@ static void qpeg_decode_inter(const uint8_t *src, uint8_t *dst, int size, filled = 0; dst -= stride; height--; + if (height < 0) + break; } } } else if(code >= 0xC0) { /* copy code: 0xC0..0xDF */ @@ -209,6 +211,8 @@ static void qpeg_decode_inter(const uint8_t *src, uint8_t *dst, int size, filled = 0; dst -= stride; height--; + if (height < 0) + break; } } size -= code + 1; |