aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-17 02:23:44 -0400
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-18 01:54:17 -0400
commit0570b0f172631ba8f3c6180d2c850635c3cd6037 (patch)
tree8caee82682bdea52ca20b051c1fe7f5e86f0b5d3
parent577f49b25c22a267fb3a29af5832f7ab0c2f4769 (diff)
downloaddeduper-0570b0f172631ba8f3c6180d2c850635c3cd6037.tar.xz
Return immediately if image is invalid.
-rw-r--r--xsig/src/signature.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/xsig/src/signature.cpp b/xsig/src/signature.cpp
index 9daf131..1f0ec28 100644
--- a/xsig/src/signature.cpp
+++ b/xsig/src/signature.cpp
@@ -270,6 +270,7 @@ signature signature::from_string(std::string &&s)
signature signature::from_preprocessed_matrix(cv::Mat *m, const signature_config &cfg)
{
+ if (!m->data) return signature();
signature_priv *p = new signature_priv;
p->cfg = cfg;
@@ -290,6 +291,7 @@ signature signature::from_preprocessed_matrix(cv::Mat *m, const signature_config
signature signature::from_cvmatrix(cv::Mat *m, const signature_config &cfg)
{
+ if (!m->data) return signature();
cv::Mat ma, bw;
double sc = 1;
switch (m->depth())