GraphicsMagick: Avoid attempts to report multiple ReadLimitExcee...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.282.1642194073.1607.graphicsmagick-commit@lists.sourceforge.net>
changeset b067afcd6aa7 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=b067afcd6aa7
summary: Avoid attempts to report multiple ReadLimitExceeded exceptions.

diffstat:

 magick/blob.c |  22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diffs (41 lines):

diff -r 5e47c783eb86 -r b067afcd6aa7 magick/blob.c
--- a/magick/blob.c	Fri Jan 14 08:42:23 2022 -0600
+++ b/magick/blob.c	Fri Jan 14 15:01:00 2022 -0600
@@ -279,11 +279,14 @@
   blob->read_total += available;
   if (available < length)
     {
-      blob->eof=True;
-      if (blob->read_limit <= blob->read_total)
+      if (MagickFalse == blob->eof)
         {
-          ThrowException(&image->exception,ResourceLimitError,ReadLimitExceeded,
-                         image->filename);
+          blob->eof=MagickTrue;
+          if (blob->read_limit <= blob->read_total)
+            {
+              ThrowException(&image->exception,ResourceLimitError,ReadLimitExceeded,
+                             image->filename);
+            }
         }
     }
   return available;
@@ -3367,11 +3370,14 @@
   blob->read_total += count;
   if (count < req_length)
     {
-      blob->eof=True;
-      if (blob->read_limit <= blob->read_total)
+      if (MagickFalse == blob->eof)
         {
-          ThrowException(&image->exception,ResourceLimitError,ReadLimitExceeded,
-                         image->filename);
+          blob->eof=MagickTrue;
+          if (blob->read_limit <= blob->read_total)
+            {
+              ThrowException(&image->exception,ResourceLimitError,ReadLimitExceeded,
+                             image->filename);
+            }
         }
     }
   return(count);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.