summaryrefslogtreecommitdiff
path: root/libavcodec/tiff.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2013-09-30 00:11:12 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2014-04-12 14:49:08 -0400
commitfdbe18b7b0545f9b5923d25a5433e4f735719ecc (patch)
tree1988f380ac704bfd20d331141d281a2e067d447c /libavcodec/tiff.c
parent0a467a9b594dd67aa96bad687d05f8845b009f18 (diff)
tiffdec: use a single strip if RowsPerStrip is 0
The spec does not specify that 0 is an error condition, and there are samples which use 0 when the whole image is in one strip.
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r--libavcodec/tiff.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 0cfa4c4972..e7f1866a3b 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -418,14 +418,9 @@ static int tiff_decode_tag(TiffContext *s)
}
break;
case TIFF_ROWSPERSTRIP:
- if (type == TIFF_LONG && value == UINT_MAX)
- value = s->avctx->height;
- if (value < 1) {
- av_log(s->avctx, AV_LOG_ERROR,
- "Incorrect value of rows per strip\n");
- return AVERROR_INVALIDDATA;
- }
- s->rps = value;
+ if (!value || (type == TIFF_LONG && value == UINT_MAX))
+ value = s->height;
+ s->rps = FFMIN(value, s->height);
break;
case TIFF_STRIP_OFFS:
if (count == 1) {