From: cristy Date: Wed, 28 Mar 2012 12:54:33 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5956 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f162e01857687440049194ac14eae3302c55a88d;p=imagemagick --- diff --git a/coders/jpeg.c b/coders/jpeg.c index b29a67c8c..c1a4137a8 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -330,6 +330,8 @@ static void JPEGErrorHandler(j_common_ptr jpeg_info) static MagickBooleanType JPEGWarningHandler(j_common_ptr jpeg_info,int level) { +#define JPEGExcessiveWarnings 1000 + char message[JMSG_LENGTH_MAX]; @@ -352,11 +354,12 @@ static MagickBooleanType JPEGWarningHandler(j_common_ptr jpeg_info,int level) Process warning message. */ (jpeg_info->err->format_message)(jpeg_info,message); + if (jpeg_info->err->num_warnings++ > JPEGExcessiveWarnings) + JPEGErrorHandler(jpeg_info); if ((jpeg_info->err->num_warnings == 0) || (jpeg_info->err->trace_level >= 3)) ThrowBinaryException(CorruptImageWarning,(char *) message, image->filename); - jpeg_info->err->num_warnings++; } else if ((image->debug != MagickFalse) && diff --git a/coders/tiff.c b/coders/tiff.c index 45b6d2635..c7a599219 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -649,7 +649,7 @@ static void TIFFGetEXIFProperties(TIFF *tiff,Image *image, ascii=(char *) NULL; if ((TIFFGetField(tiff,exif_info[i].tag,&ascii,&sans,&sans) != 0) && (ascii != (char *) NULL) && (*ascii != '\0')) - (void) CopyMagickMemory(value,ascii,MaxTextExtent); + (void) CopyMagickString(value,ascii,MaxTextExtent); break; } case TIFF_SHORT: