diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-09 19:28:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-09 19:28:57 +0100 |
commit | 02a325cb6fdc1e33a45191cbfbfe4298affcd021 (patch) | |
tree | 5989900ea0b7ea8b02f7138dd84c5316d60ce08d /libavcodec/tiff.c | |
parent | b8dc5f8bb3b14bfd2289a0444c7b706299555d97 (diff) | |
download | ffmpeg-02a325cb6fdc1e33a45191cbfbfe4298affcd021.tar.gz |
tiffdec: check rps, fix infinite loop.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r-- | libavcodec/tiff.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 45c247694e..f00b1adc37 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1089,6 +1089,11 @@ static int decode_frame(AVCodecContext *avctx, bytestream2_init(&stripdata, avpkt->data + s->strippos, avpkt->size - s->strippos); } + if (s->rps <= 0) { + av_log(avctx, AV_LOG_ERROR, "rps %d invalid\n", s->rps); + return AVERROR_INVALIDDATA; + } + for (i = 0; i < s->height; i += s->rps) { if (s->stripsizesoff) ssize = tget(&stripsizes, s->sstype, s->le); |