- dst = p->data[plane];
- for (i = 0; i < s->height; i += s->rps) {
- if (s->stripsizesoff)
- ssize = ff_tget(&stripsizes, s->sstype, le);
- else
- ssize = s->stripsize;
-
- if (s->strippos)
- soff = ff_tget(&stripdata, s->sot, le);
- else
- soff = s->stripoff;
-
- if (soff > avpkt->size || ssize > avpkt->size - soff) {
- av_log(avctx, AV_LOG_ERROR, "Invalid strip size/offset\n");
- return AVERROR_INVALIDDATA;
- }
- if ((ret = tiff_unpack_strip(s, p, dst, stride, avpkt->data + soff, ssize, i,
- FFMIN(s->rps, s->height - i))) < 0) {
- if (avctx->err_recognition & AV_EF_EXPLODE)
- return ret;
- break;
- }
- dst += s->rps * stride;
- }
- if (s->predictor == 2) {
- if (s->photometric == TIFF_PHOTOMETRIC_YCBCR) {
- av_log(s->avctx, AV_LOG_ERROR, "predictor == 2 with YUV is unsupported");
- return AVERROR_PATCHWELCOME;
+ dst = p->data[plane];
+ for (i = 0; i < s->height; i += s->rps) {
+ if (s->stripsizesoff)
+ ssize = ff_tget(&stripsizes, s->sstype, le);
+ else
+ ssize = s->stripsize;
+
+ if (s->strippos)
+ soff = ff_tget(&stripdata, s->sot, le);
+ else
+ soff = s->stripoff;
+
+ if (soff > avpkt->size || ssize > avpkt->size - soff) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid strip size/offset\n");
+ return AVERROR_INVALIDDATA;
+ }
+ if ((ret = tiff_unpack_strip(s, p, dst, stride, avpkt->data + soff, ssize, i,
+ FFMIN(s->rps, s->height - i))) < 0) {
+ if (avctx->err_recognition & AV_EF_EXPLODE)
+ return ret;
+ break;
+ }
+ dst += s->rps * stride;