Commit 02a325cb authored by Michael Niedermayer's avatar Michael Niedermayer

tiffdec: check rps, fix infinite loop.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b8dc5f8b
...@@ -1089,6 +1089,11 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -1089,6 +1089,11 @@ static int decode_frame(AVCodecContext *avctx,
bytestream2_init(&stripdata, avpkt->data + s->strippos, avpkt->size - s->strippos); 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) { for (i = 0; i < s->height; i += s->rps) {
if (s->stripsizesoff) if (s->stripsizesoff)
ssize = tget(&stripsizes, s->sstype, s->le); ssize = tget(&stripsizes, s->sstype, s->le);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment