aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Renieris <velocityra@gmail.com>2019-08-29 16:10:46 +0300
committerPaul B Mahol <onemda@gmail.com>2019-09-02 09:26:52 +0200
commit33b6752a708f9afc2a99a86ff28a42803e52bc28 (patch)
treed56d3dabc2e1cdfa97d1cf33c8dae953b406909a
parentf98a8666de6cdd8426e0ddf0272322498225467d (diff)
downloadffmpeg-33b6752a708f9afc2a99a86ff28a42803e52bc28.tar.gz
lavc/tiff: Don't apply strips-related logic to tiled images
Signed-off-by: Nick Renieris <velocityra@gmail.com>
-rw-r--r--libavcodec/tiff.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 816fb930c7..b4015178f2 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1790,7 +1790,7 @@ again:
}
}
- if (!s->strippos && !s->stripoff) {
+ if (!s->is_tiled && !s->strippos && !s->stripoff) {
av_log(avctx, AV_LOG_ERROR, "Image data is missing\n");
return AVERROR_INVALIDDATA;
}
@@ -1798,27 +1798,29 @@ again:
if ((ret = init_image(s, &frame)) < 0)
return ret;
- if (s->strips == 1 && !s->stripsize) {
- av_log(avctx, AV_LOG_WARNING, "Image data size missing\n");
- s->stripsize = avpkt->size - s->stripoff;
- }
+ if (!s->is_tiled) {
+ if (s->strips == 1 && !s->stripsize) {
+ av_log(avctx, AV_LOG_WARNING, "Image data size missing\n");
+ s->stripsize = avpkt->size - s->stripoff;
+ }
- if (s->stripsizesoff) {
- if (s->stripsizesoff >= (unsigned)avpkt->size)
- return AVERROR_INVALIDDATA;
- bytestream2_init(&stripsizes, avpkt->data + s->stripsizesoff,
- avpkt->size - s->stripsizesoff);
- }
- if (s->strippos) {
- if (s->strippos >= (unsigned)avpkt->size)
- return AVERROR_INVALIDDATA;
- bytestream2_init(&stripdata, avpkt->data + s->strippos,
- avpkt->size - s->strippos);
- }
+ if (s->stripsizesoff) {
+ if (s->stripsizesoff >= (unsigned)avpkt->size)
+ return AVERROR_INVALIDDATA;
+ bytestream2_init(&stripsizes, avpkt->data + s->stripsizesoff,
+ avpkt->size - s->stripsizesoff);
+ }
+ if (s->strippos) {
+ if (s->strippos >= (unsigned)avpkt->size)
+ return AVERROR_INVALIDDATA;
+ bytestream2_init(&stripdata, avpkt->data + s->strippos,
+ avpkt->size - s->strippos);
+ }
- if (s->rps <= 0 || s->rps % s->subsampling[1]) {
- av_log(avctx, AV_LOG_ERROR, "rps %d invalid\n", s->rps);
- return AVERROR_INVALIDDATA;
+ if (s->rps <= 0 || s->rps % s->subsampling[1]) {
+ av_log(avctx, AV_LOG_ERROR, "rps %d invalid\n", s->rps);
+ return AVERROR_INVALIDDATA;
+ }
}
/* Handle DNG images with JPEG-compressed tiles */