summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-03-21 16:41:41 +0000
committerrillig <rillig@pkgsrc.org>2020-03-21 16:41:41 +0000
commit8063a293e3c4527d9d2fb18b8e27590ef8b14686 (patch)
tree171a598ef988dc28085701359ffd8bf4372d89f5 /graphics
parent2a3337c077651067c25267ec4407b216e94708d9 (diff)
downloadpkgsrc-8063a293e3c4527d9d2fb18b8e27590ef8b14686.tar.gz
graphics/freeimage: add patch for char subscript in array
Diffstat (limited to 'graphics')
-rw-r--r--graphics/freeimage/distinfo3
-rw-r--r--graphics/freeimage/patches/patch-Source_LibRawLite_internal_dcraw__common.cpp24
2 files changed, 26 insertions, 1 deletions
diff --git a/graphics/freeimage/distinfo b/graphics/freeimage/distinfo
index f9d3ac0e562..6ba3d552b6a 100644
--- a/graphics/freeimage/distinfo
+++ b/graphics/freeimage/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2020/01/11 14:40:44 nia Exp $
+$NetBSD: distinfo,v 1.8 2020/03/21 16:41:41 rillig Exp $
SHA1 (FreeImage3180.zip) = 38daa9d8f1bca2330a2eaa42ec66fbe6ede7dce9
RMD160 (FreeImage3180.zip) = b791715fccf49355a3cb27b6250d8ed809c2454e
@@ -7,3 +7,4 @@ Size (FreeImage3180.zip) = 7415716 bytes
SHA1 (patch-Makefile) = d453337cb2a34f4480d1bd3c2115cb93715170b8
SHA1 (patch-Makefile.fip) = 466b82e70d06f9552a73d86a742aa1bd3450f881
SHA1 (patch-Source_LibOpenJPEG_opj__malloc.h) = 7e8b65d17cf1f0ed295964d477b96acac56bd927
+SHA1 (patch-Source_LibRawLite_internal_dcraw__common.cpp) = 3f9a149c7294b3ed3f2c17f4c28fe5b7cc223838
diff --git a/graphics/freeimage/patches/patch-Source_LibRawLite_internal_dcraw__common.cpp b/graphics/freeimage/patches/patch-Source_LibRawLite_internal_dcraw__common.cpp
new file mode 100644
index 00000000000..2a21729267a
--- /dev/null
+++ b/graphics/freeimage/patches/patch-Source_LibRawLite_internal_dcraw__common.cpp
@@ -0,0 +1,24 @@
+$NetBSD: patch-Source_LibRawLite_internal_dcraw__common.cpp,v 1.1 2020/03/21 16:41:41 rillig Exp $
+
+Source/LibRawLite/internal/dcraw_common.cpp: In member function 'void LibRaw::xtrans_interpolate(int)':
+Source/LibRawLite/internal/dcraw_common.cpp:5879:27: error: array subscript has type 'char' [-Werror=char-subscripts]
+ cstat[fcol(row, col)]++;
+ ^
+
+The expected values for fcol must be in the range 0..3 anyway, otherwise
+the behavior is undefined. Instead of using char, it would probably be
+better to use uint8_t here.
+
+https://sourceforge.net/p/freeimage/bugs/322/
+
+--- Source/LibRawLite/internal/dcraw_common.cpp.orig 2018-06-30 02:08:06.000000000 +0000
++++ Source/LibRawLite/internal/dcraw_common.cpp
+@@ -5876,7 +5876,7 @@ void CLASS xtrans_interpolate(int passes
+ /* Check against right pattern */
+ for (row = 0; row < 6; row++)
+ for (col = 0; col < 6; col++)
+- cstat[fcol(row, col)]++;
++ cstat[(unsigned char)fcol(row, col)]++;
+
+ if (cstat[0] < 6 || cstat[0] > 10 || cstat[1] < 16 || cstat[1] > 24 || cstat[2] < 6 || cstat[2] > 10 || cstat[3])
+ throw LIBRAW_EXCEPTION_IO_CORRUPT;