summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/tiff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 7190f48310..34aab924d3 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -963,6 +963,9 @@ static int dng_decode_tiles(AVCodecContext *avctx, AVFrame *frame,
int pos_x = 0, pos_y = 0;
int ret;
+ if (s->tile_width <= 0 || s->tile_length <= 0)
+ return AVERROR_INVALIDDATA;
+
has_width_leftover = (s->width % s->tile_width != 0);
has_height_leftover = (s->height % s->tile_length != 0);