From 50f54462076648ac2e36c3f58f4dadd4babbf1c9 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 1 Sep 2017 09:22:37 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/713 --- coders/txt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coders/txt.c b/coders/txt.c index 16e7ac2e9..051f6bef2 100644 --- a/coders/txt.c +++ b/coders/txt.c @@ -446,7 +446,9 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); image->columns=width; image->rows=height; - for (depth=1; (GetQuantumRange(depth)+1) < max_value; depth++) ; + for (depth=1; (GetQuantumRange(depth)+1) < max_value; depth++) + if (depth >= 64) + break; image->depth=depth; status=SetImageExtent(image,image->columns,image->rows,exception); if (status == MagickFalse) -- 2.40.0