From 084b26aa7aa440554867a5ecd6a22574d60183b3 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 10 Mar 2018 20:40:56 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6259 --- coders/txt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/coders/txt.c b/coders/txt.c index e03d45e70..af0dc88cb 100644 --- a/coders/txt.c +++ b/coders/txt.c @@ -473,6 +473,7 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) SetImageBackgroundColor(image,exception); GetPixelInfo(image,&pixel); range=GetQuantumRange(image->depth); + status=MagickTrue; for (y=0; y < (ssize_t) image->rows; y++) { double @@ -482,6 +483,8 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) green, red; + if (status == MagickFalse) + break; red=0.0; green=0.0; blue=0.0; @@ -490,7 +493,10 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) for (x=0; x < (ssize_t) image->columns; x++) { if (ReadBlobString(image,text) == (char *) NULL) - break; + { + status=MagickFalse; + break; + } switch (image->colorspace) { case LinearGRAYColorspace: @@ -568,7 +574,10 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) continue; SetPixelViaPixelInfo(image,&pixel,q); if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; + { + status=MagickFalse; + break; + } } } *text='\0'; -- 2.40.0