GraphicsMagick: 2 new changesets

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.913.1683357791.7928.graphicsmagick-commit@lists.sourceforge.net>
changeset 34d31473fb58 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=34d31473fb58
summary: coders/topol.c Function "CheckFName" has been carefuly tested against garbage in clone_info->filename.

changeset 2bedd42a0797 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=2bedd42a0797
summary: Merge branches.

diffstat:

 ChangeLog          |   4 ++++
 coders/topol.c     |  28 ++++++++++++++++------------
 tests/rwfile.tap   |   9 ++++++++-
 www/Changelog.html |  12 ++++++++++++
 4 files changed, 40 insertions(+), 13 deletions(-)

diffs (124 lines):

diff -r 1364345f71bf -r 2bedd42a0797 ChangeLog
--- a/ChangeLog	Sat May 06 00:03:08 2023 +0200
+++ b/ChangeLog	Sat May 06 09:22:38 2023 +0200
@@ -1,3 +1,7 @@
+2023-05-05  Bob Friesenhahn  <[email protected]>
+
+	* coders/topol.c (RegisterTOPOLImage): Set adjoin to MagickFalse.
+
 2023-05-06  Fojtik Jaroslav  <[email protected]>
 
 	* coders/topol.c: Fix situation when GetBlobSize returns negative value.
diff -r 1364345f71bf -r 2bedd42a0797 coders/topol.c
--- a/coders/topol.c	Sat May 06 00:03:08 2023 +0200
+++ b/coders/topol.c	Sat May 06 09:22:38 2023 +0200
@@ -325,30 +325,30 @@
 {
 size_t j;
   if(clone_info==NULL || i==NULL) return NULL;
-  //if((clone_info=CloneImageInfo(clone_info)) == NULL) return NULL;
 
-  *i = strnlen(clone_info->filename, sizeof(clone_info->filename));
-  if(*i >= sizeof(clone_info->filename))
+  j = *i = strnlen(clone_info->filename, sizeof(clone_info->filename));
+  if(j>=sizeof(clone_info->filename) || j==0)
   {
     DestroyImageInfo(clone_info);
     return NULL;
   }
 
-  j = *i;
-  while(--*i > 0)
+  while(--j > 0)
   {
-    if(clone_info->filename[*i]=='.')
-    {
-      break;
-    }
-    if(clone_info->filename[*i]=='/' || clone_info->filename[*i]=='\\' || clone_info->filename[*i]==':' )
+    const char c = clone_info->filename[j];
+    if(c == '.')
     {
       *i = j;
       break;
     }
+    if(c=='/' || c=='\\' || c==':')
+    {
+      j = *i;
+      break;	/* *i will remain intact. */
+    }
   }
 
-  if(*i <= 0)
+  if(j <= 0)
   {
     DestroyImageInfo(clone_info);
     return NULL;
@@ -542,7 +542,10 @@
 
   j = GetBlobSize(image);
   if(j<512)			// Header size=512bytes; negative number means failure.
-      goto TOPOL_KO;
+  {
+    fprintf(stderr,"TopoL: GetBlobSize() returned small or negative value %ld!",j);
+    goto TOPOL_KO;
+  }
 
   /* If ping is true, then only set image size and colors without reading any image data. */
   if (image_info->ping) goto DONE_READING;
@@ -1081,6 +1084,7 @@
   entry->magick = (MagickHandler) IsTopoL;
   entry->seekable_stream = True;
   entry->description = "TopoL X Image";
+  entry->adjoin=MagickFalse;
   entry->module = "TOPOL";
   (void) RegisterMagickInfo(entry);
 }
diff -r 1364345f71bf -r 2bedd42a0797 tests/rwfile.tap
--- a/tests/rwfile.tap	Sat May 06 00:03:08 2023 +0200
+++ b/tests/rwfile.tap	Sat May 06 09:22:38 2023 +0200
@@ -12,7 +12,7 @@
 check_types_noone='bilevel gray pallette truecolor'
 
 # Number of tests we plan to run
-test_plan_fn 828 # 830
+test_plan_fn 828 # 838
 
 # ART format
 for type in ${check_types}
@@ -427,6 +427,13 @@
   test_command_fn "TGA ${type} (stdio)" ${MEMCHECK} ${rwfile} -stdio -filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" TGA
 done
 
+# TOPOL format
+#for type in ${check_types}
+#do
+#  test_command_fn "TOPOL ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" "${SRCDIR}/input_${type}.miff" TOPOL
+#  test_command_fn "TOPOL ${type} (stdio)" ${MEMCHECK} ${rwfile} -stdio -filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" TOPOL
+#done
+
 # TXT format
 for type in ${check_types}
 do
diff -r 1364345f71bf -r 2bedd42a0797 www/Changelog.html
--- a/www/Changelog.html	Sat May 06 00:03:08 2023 +0200
+++ b/www/Changelog.html	Sat May 06 09:22:38 2023 +0200
@@ -40,6 +40,18 @@
 <p>2023-05-05  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>
 <ul class="simple">
+<li><p>coders/topol.c (RegisterTOPOLImage): Set adjoin to MagickFalse.</p></li>
+</ul>
+</blockquote>
+<p>2023-05-06  Fojtik Jaroslav  &lt;<a class="reference external" href="mailto:JaFojtik&#37;&#52;&#48;yandex&#46;com">JaFojtik<span>&#64;</span>yandex<span>&#46;</span>com</a>&gt;</p>
+<blockquote>
+<ul class="simple">
+<li><p>coders/topol.c: Fix situation when GetBlobSize returns negative value.</p></li>
+</ul>
+</blockquote>
+<p>2023-05-05  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>
+<ul class="simple">
 <li><p>coders/heif.c (ReadHEIFImage): Implemented Tobias Mark's idea
 for how ignore_transformations should be supported for older
 libheif versions.</p></li>
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.