From: dirk Date: Sun, 4 May 2014 20:46:11 +0000 (+0000) Subject: Fixed order of nested exceptions. X-Git-Tag: 7.0.1-0~2362 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aea390f6c0ad07cd3eae232d1e02801ee3ad42ac;p=imagemagick Fixed order of nested exceptions. --- diff --git a/Magick++/lib/Exception.cpp b/Magick++/lib/Exception.cpp index acebe2819..a6cd8c650 100644 --- a/Magick++/lib/Exception.cpp +++ b/Magick++/lib/Exception.cpp @@ -833,6 +833,9 @@ MagickPPExport void Magick::throwException(ExceptionInfo &exception_) MagickBooleanType relinquish; + size_t + index; + // Just return if there is no reported error if (exception_.severity == UndefinedException) return; @@ -842,11 +845,12 @@ MagickPPExport void Magick::throwException(ExceptionInfo &exception_) LockSemaphoreInfo(exception_.semaphore); if (exception_.exceptions != (void *) NULL) { - ResetLinkedListIterator((LinkedListInfo *) exception_.exceptions); - p=(const ExceptionInfo *) GetNextValueInLinkedList((LinkedListInfo *) + index=GetNumberOfElementsInLinkedList((LinkedListInfo *) exception_.exceptions); - while (p != (const ExceptionInfo *) NULL) + while(index > 0) { + p=(const ExceptionInfo *) GetValueFromLinkedList((LinkedListInfo *) + exception_.exceptions,--index); if ((p->severity != exception_.severity) || (LocaleCompare(p->reason, exception_.reason) != 0) || (LocaleCompare(p->description, exception_.description) != 0)) @@ -860,8 +864,6 @@ MagickPPExport void Magick::throwException(ExceptionInfo &exception_) nestedException=q; } } - p=(const ExceptionInfo *) GetNextValueInLinkedList((LinkedListInfo *) - exception_.exceptions); } } UnlockSemaphoreInfo(exception_.semaphore); diff --git a/Magick++/lib/Magick++/Include.h b/Magick++/lib/Magick++/Include.h index 12e1f0e5a..d9bc27e62 100644 --- a/Magick++/lib/Magick++/Include.h +++ b/Magick++/lib/Magick++/Include.h @@ -1235,6 +1235,7 @@ namespace Magick using MagickCore::GetMagickInfo; using MagickCore::GetMultilineTypeMetrics; using MagickCore::GetNextValueInLinkedList; + using MagickCore::GetNumberOfElementsInLinkedList; using MagickCore::GetPixelBlue; using MagickCore::GetPixelGreen; using MagickCore::GetPixelInfo; @@ -1245,6 +1246,7 @@ namespace Magick using MagickCore::GetStringInfoDatum; using MagickCore::GetStringInfoLength; using MagickCore::GetTypeMetrics; + using MagickCore::GetValueFromLinkedList; using MagickCore::GetVirtualMetacontent; using MagickCore::GetVirtualPixels; using MagickCore::GetImageVirtualPixelMethod;