GraphicsMagick: 2 new changesets

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.257.1641740561.1738.graphicsmagick-commit@lists.sourceforge.net>
changeset 4870b654f4bb in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=4870b654f4bb
summary: Eliminate signed vs unsigned warnings.

changeset e8eab91c6d23 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=e8eab91c6d23
summary: magick/blob.c: Make sure that read resource limiting can support very large files.

diffstat:

 ChangeLog                              |   5 +++++
 VisualMagick/installer/inc/version.isx |   4 ++--
 coders/mat.c                           |  12 ++++++------
 magick/blob.c                          |  11 +++++++----
 magick/version.h                       |   4 ++--
 www/Changelog.html                     |   4 ++++
 6 files changed, 26 insertions(+), 14 deletions(-)

diffs (147 lines):

diff -r 121de89bed95 -r e8eab91c6d23 ChangeLog
--- a/ChangeLog	Sat Jan 08 17:14:10 2022 -0600
+++ b/ChangeLog	Sun Jan 09 09:02:30 2022 -0600
@@ -1,3 +1,8 @@
+2022-01-09  Bob Friesenhahn  <[email protected]>
+
+        * magick/blob.c: Make sure that read resource limiting can support
+        very large files.
+
 2022-01-08  Bob Friesenhahn  <[email protected]>
 
         * magick/resource.c: Add support for setting a read resource limit
diff -r 121de89bed95 -r e8eab91c6d23 VisualMagick/installer/inc/version.isx
--- a/VisualMagick/installer/inc/version.isx	Sat Jan 08 17:14:10 2022 -0600
+++ b/VisualMagick/installer/inc/version.isx	Sun Jan 09 09:02:30 2022 -0600
@@ -10,5 +10,5 @@
 
 #define public MagickPackageName "GraphicsMagick"
 #define public MagickPackageVersion "1.4"
-#define public MagickPackageVersionAddendum ".020220108"
-#define public MagickPackageReleaseDate "snapshot-20220108"
+#define public MagickPackageVersionAddendum ".020220109"
+#define public MagickPackageReleaseDate "snapshot-20220109"
diff -r 121de89bed95 -r e8eab91c6d23 coders/mat.c
--- a/coders/mat.c	Sat Jan 08 17:14:10 2022 -0600
+++ b/coders/mat.c	Sun Jan 09 09:02:30 2022 -0600
@@ -151,7 +151,7 @@
 /* Add coloring to gray image. C=R+j*Q. Colors to red when Q>0 and blue for Q<0.
  Please note that this function expects gray image on input. Additional channel contents
  checking is wasting of resources only. */
-static void InsertComplexDoubleRow(double *p, int y, Image *image, double MinVal,
+static void InsertComplexDoubleRow(double *p, long y, Image *image, double MinVal,
                                   double MaxVal)
 {
   double f;
@@ -211,7 +211,7 @@
 /* Add coloring to gray image. C=R+j*Q. Colors to red when Q>0 and blue for Q<0.
  Please note that this function expects gray image on input. Additional channel contents
  checking is wasting of resources only. */
-static void InsertComplexFloatRow(float *p, int y, Image *image, double MinVal, double MaxVal)
+static void InsertComplexFloatRow(float *p, long y, Image *image, double MinVal, double MaxVal)
 {
   double f;
   int x;
@@ -1172,7 +1172,7 @@
                 /* else read color scanlines */
     do
     {
-      for(i = 0; i < (long) MATLAB_HDR.SizeY; i++)
+      for(i = 0; i < MATLAB_HDR.SizeY; i++)
       {
         q = SetImagePixelsEx(image,0,MATLAB_HDR.SizeY-i-1,image->columns,1,&image->exception);
         if (q == (PixelPacket *)NULL)
@@ -1223,7 +1223,7 @@
     } while(z-- >= 2);
 ExitLoop:
 
-    if (i != (long) MATLAB_HDR.SizeY)
+    if (i != MATLAB_HDR.SizeY)
       {
         if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
                                           "Failed to read all scanlines (failed at row %d of %u rows, z=%d)",
@@ -1257,7 +1257,7 @@
       }
 
       if (CellType==miDOUBLE)
-        for (i = 0; i < (long) MATLAB_HDR.SizeY; i++)
+        for (i = 0; i < MATLAB_HDR.SizeY; i++)
         {
           if (ReadBlobXXXDoubles(image2, ldblk, (double *)BImgBuff) != ldblk)
             ThrowImg2MATReaderException(CorruptImageError,UnexpectedEndOfFile,image);
@@ -1265,7 +1265,7 @@
         }
 
       if (CellType==miSINGLE)
-        for (i = 0; i < (long) MATLAB_HDR.SizeY; i++)
+        for (i = 0; i < MATLAB_HDR.SizeY; i++)
         {
           if (ReadBlobXXXFloats(image2, ldblk, (float *)BImgBuff) != ldblk)
             ThrowImg2MATReaderException(CorruptImageError,UnexpectedEndOfFile,image);
diff -r 121de89bed95 -r e8eab91c6d23 magick/blob.c
--- a/magick/blob.c	Sat Jan 08 17:14:10 2022 -0600
+++ b/magick/blob.c	Sun Jan 09 09:02:30 2022 -0600
@@ -100,12 +100,14 @@
 
 struct _BlobInfo
 {
+  magick_uint64_t
+    read_limit,         /* Limit on data to return to API user */
+    read_total;         /* Amount of data read thus far */
+
   size_t
     block_size,         /* I/O block size */
     length,             /* The current size of the BLOB data. */
     extent,             /* The amount of backing store currently allocated */
-    read_limit,         /* Limit on data to return to user */
-    read_total,         /* Amount of data read thus far */
     quantum;            /* The amount by which to increase the size of the backing store */
 
   unsigned int
@@ -271,7 +273,8 @@
       return 0;
     }
   *data=(void *)(blob->data+blob->offset);
-  available=Min(Min(length,blob->read_limit-blob->read_total),blob->length-blob->offset);
+  available=Min(Min(length,blob->read_limit-blob->read_total),
+                blob->length-blob->offset);
   blob->offset+=available;
   if (available == 0)
     blob->eof=True;
@@ -2722,7 +2725,7 @@
   /*
     Set read limits
   */
-  image->blob->read_limit = (size_t) GetMagickResourceLimit(ReadResource);
+  image->blob->read_limit = (magick_uint64_t) GetMagickResourceLimit(ReadResource);
   image->blob->read_total = 0;
   /*
     Cache I/O block size
diff -r 121de89bed95 -r e8eab91c6d23 magick/version.h
--- a/magick/version.h	Sat Jan 08 17:14:10 2022 -0600
+++ b/magick/version.h	Sun Jan 09 09:02:30 2022 -0600
@@ -38,8 +38,8 @@
 #define MagickLibVersion  0x262300
 #define MagickLibVersionText  "1.4"
 #define MagickLibVersionNumber 26,23,0
-#define MagickChangeDate   "20220108"
-#define MagickReleaseDate  "snapshot-20220108"
+#define MagickChangeDate   "20220109"
+#define MagickReleaseDate  "snapshot-20220109"
 
 /*
   The MagickLibInterfaceNewest and MagickLibInterfaceOldest defines
diff -r 121de89bed95 -r e8eab91c6d23 www/Changelog.html
--- a/www/Changelog.html	Sat Jan 08 17:14:10 2022 -0600
+++ b/www/Changelog.html	Sun Jan 09 09:02:30 2022 -0600
@@ -35,6 +35,10 @@
 <div class="document">
 
 
+<p>2022-01-09  Bob Friesenhahn  &lt;<a class="reference external" href="mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>
+<blockquote>
+* magick/blob.c: Make sure that read resource limiting can support
+very large files.</blockquote>
 <p>2022-01-08  Bob Friesenhahn  &lt;<a class="reference external" href="mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>
 <blockquote>
 <p>* magick/resource.c: Add support for setting a read resource limit
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.