Browse Source

tiffdec: check rps, fix infinite loop.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
02a325cb6f
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/tiff.c

+ 5
- 0
libavcodec/tiff.c View File

@@ -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);


Loading…
Cancel
Save