GraphicsMagick: coders/tiff.c: Fix endianity problem related to ...

GraphicsMagick Commits <[email protected]> Mon, 05 Feb 2024 17:27:54 -0600
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.4529.1707175681.1744.graphicsmagick-commit@lists.sourceforge.net>
changeset 129b1164b3f9 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=129b1164b3f9
summary: coders/tiff.c: Fix endianity problem related to string packed in a DWORD.

diffstat:

 ChangeLog     |  4 ++++
 coders/tiff.c |  5 ++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 57e9448a86e2 -r 129b1164b3f9 ChangeLog
--- a/ChangeLog	Mon Feb 05 20:54:45 2024 +0100
+++ b/ChangeLog	Tue Feb 06 00:27:28 2024 +0100
@@ -1,3 +1,7 @@
+2024-02-06  Fojtik Jaroslav  <[email protected]>
+
+	* coders/tiff.c: Fix endianity problem related to string packed in a DWORD.
+
 2024-02-05  Fojtik Jaroslav  <[email protected]>
 
 	* coders/tiff.c: Ability to handle EXIF strings without zero termination.
diff -r 57e9448a86e2 -r 129b1164b3f9 coders/tiff.c
--- a/coders/tiff.c	Mon Feb 05 20:54:45 2024 +0100
+++ b/coders/tiff.c	Tue Feb 06 00:27:28 2024 +0100
@@ -4562,11 +4562,10 @@
         {
           case TIFF_ASCII:
                          if(FDT!=TIFF_ASCII)
-                             break;	/* Incompatible recipe.*/
+                             break;		/* Incompatible recipe.*/
                          if(Long2<=4)
                          {
-                           ((char*)&Long2)[3] = 0;			/* Force string terminator for safety. */
-                           if(TIFFSetField(tiff, Tag, &Value))		/* The short string is inside Value. */
+                           if(CheckAndStoreStr(tiff, Tag, IFD_data+8, Long2))	/* The short string is inside Value. */
                              FieldCount++;
                          }
                          else