GraphicsMagick: coders/tiff.c Prevent sign expansion and bogus c...

GraphicsMagick Commits <[email protected]> Fri, 12 Jan 2024 22:51:36 -0600
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.2398.1705121523.25875.graphicsmagick-commit@lists.sourceforge.net>
changeset 7e86efd48b53 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=7e86efd48b53
summary: coders/tiff.c Prevent sign expansion and bogus contents in upper 2 bytes for TIFF_SHORT.

diffstat:

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

diffs (24 lines):

diff -r f37c7cff863f -r 7e86efd48b53 ChangeLog
--- a/ChangeLog	Fri Jan 12 09:22:03 2024 +0100
+++ b/ChangeLog	Sat Jan 13 05:51:16 2024 +0100
@@ -1,3 +1,8 @@
+2024-01-13  Fojtik Jaroslav  <[email protected]>
+
+        coders/tiff.c Prevent sign expansion and bogus contents in 
+	upper 2 bytes for TIFF_SHORT.
+
 2024-01-12  Fojtik Jaroslav  <[email protected]>
 
         coders/tiff.c Fixed TIFF_RATIONAL extraction from EXIF.
diff -r f37c7cff863f -r 7e86efd48b53 coders/tiff.c
--- a/coders/tiff.c	Fri Jan 12 09:22:03 2024 +0100
+++ b/coders/tiff.c	Sat Jan 13 05:51:16 2024 +0100
@@ -4545,7 +4545,7 @@
                              break;
                          if(FDT==TIFF_SHORT)
                          {
-                           if(TIFFSetField(tiff, Tag, (int)Value))
+                           if(TIFFSetField(tiff, Tag, (unsigned)Value & 0xFFFF))
                              FieldCount++;
                            break;
                          }