From 70551314f8f9cd6664044e0114278d036fd58606 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Fri, 11 Jan 2019 09:58:30 +0100 Subject: [PATCH] When the exception list limit has been reached and the current exception is an error we allow one extra exception to make sure an error is thrown. --- MagickCore/exception.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/MagickCore/exception.c b/MagickCore/exception.c index dcd960f0c..e7d4d5a92 100644 --- a/MagickCore/exception.c +++ b/MagickCore/exception.c @@ -933,8 +933,17 @@ MagickExport MagickBooleanType ThrowException(ExceptionInfo *exception, exceptions=(LinkedListInfo *) exception->exceptions; if (GetNumberOfElementsInLinkedList(exceptions) > MaxExceptionList) { - UnlockSemaphoreInfo(exception->semaphore); - return(MagickTrue); + if (severity < ErrorException) + { + UnlockSemaphoreInfo(exception->semaphore); + return(MagickTrue); + } + p=(ExceptionInfo *) GetLastValueInLinkedList(exceptions); + if (p->severity >= ErrorException) + { + UnlockSemaphoreInfo(exception->semaphore); + return(MagickTrue); + } } p=(ExceptionInfo *) GetLastValueInLinkedList(exceptions); if ((p != (ExceptionInfo *) NULL) && (p->severity == severity) && -- 2.40.0