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.
}
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) {