summaryrefslogtreecommitdiff
path: root/media-libs/zxing-cpp/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-01-10 06:19:57 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-01-10 06:19:57 +0000
commit30f491533785a455cdfbd05bb57f1f869a8e41bb (patch)
tree231d01a9349dfa1f56a7235017f5201a7382c652 /media-libs/zxing-cpp/files
parenta96f1a2ca235a5eb9e7c498636cd1291be76cb09 (diff)
gentoo auto-resync : 10:01:2023 - 06:19:57
Diffstat (limited to 'media-libs/zxing-cpp/files')
-rw-r--r--media-libs/zxing-cpp/files/zxing-cpp-2.0.0-fix-crash.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/media-libs/zxing-cpp/files/zxing-cpp-2.0.0-fix-crash.patch b/media-libs/zxing-cpp/files/zxing-cpp-2.0.0-fix-crash.patch
new file mode 100644
index 000000000000..e6b25633e8e9
--- /dev/null
+++ b/media-libs/zxing-cpp/files/zxing-cpp-2.0.0-fix-crash.patch
@@ -0,0 +1,24 @@
+From 23c19c5f98602a4d69d1667fff99678308b28b5b Mon Sep 17 00:00:00 2001
+From: liule <levie.liu@gmail.com>
+Date: Fri, 6 Jan 2023 22:06:24 +0800
+Subject: [PATCH] fix crash when the source image is less than 3 pixels
+ width/height
+
+---
+ core/src/ReadBarcode.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/core/src/ReadBarcode.cpp b/core/src/ReadBarcode.cpp
+index 905dd191c..5ac61e250 100644
+--- a/core/src/ReadBarcode.cpp
++++ b/core/src/ReadBarcode.cpp
+@@ -76,7 +76,8 @@ class LumImagePyramid
+
+ layers.push_back(iv);
+ // TODO: if only matrix codes were considered, then using std::min would be sufficient (see #425)
+- while (threshold > 0 && std::max(layers.back().width(), layers.back().height()) > threshold)
++ while (threshold > 0 && std::max(layers.back().width(), layers.back().height()) > threshold &&
++ std::min(layers.back().width(), layers.back().height()) >= N)
+ addLayer();
+ #if 0
+ // Reversing the layers means we'd start with the smallest. that can make sense if we are only looking for a