<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>517942</bug_id>
          
          <creation_ts>2026-03-21 10:03:27 +0000</creation_ts>
          <short_desc>Qt assertion failure due to integer overflow in facepipeline.</short_desc>
          <delta_ts>2026-03-21 12:14:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>digikam</product>
          <component>Faces-Detection</component>
          <version>8.8.0</version>
          <rep_platform>Manjaro</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Peta">p.kde</reporter>
          <assigned_to name="Digikam Developers">digikam-bugs-null</assigned_to>
          <cc>caulier.gilles</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2505136</commentid>
    <comment_count>0</comment_count>
    <who name="Peta">p.kde</who>
    <bug_when>2026-03-21 10:03:27 +0000</bug_when>
    <thetext>SUMMARY

when I click on &quot;scan for faces&quot; when digikam starts, it crashes after several seconds with this log:

STEPS TO REPRODUCE
1. aFAsaEzQqM found a way to reproduce the crash, see https://discuss.kde.org/t/digikam-crashes-when-starting-to-scan-faces-with-qt6-error/43970/2?u=peta
2. &quot;I just now created a new screenshot with the dimensions 1273:23 pixels and put that in a new empty album. Trying to view that album or scanning its faces also caused the same crash.&quot;

OBSERVED RESULT

ASSERT failure in constexpr QtPrivate::QCheckedIntegers::QCheckedInt&lt;int&gt; QtPrivate::QCheckedIntegers::operator-(QCheckedInt&lt;int&gt;, QCheckedInt&lt;int&gt;): &quot;Overflow in operator-&quot;, file /usr/include/qt6/QtCore/qcheckedint_impl.h, line 69
[1]    6076 IOT instruction (core dumped)  digikam

EXPECTED RESULT

well, should not crash :-D

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro Linux x86_64
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.2

ADDITIONAL INFORMATION

britiger suggested a fix:

diff --git a/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp b/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp
index 43d6ba65d1..3d54c14f1b 100644
--- a/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp
+++ b/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp
@@ -415,6 +415,10 @@ bool FacePipelineDetectRecognize::extractor()
                 int width   = static_cast&lt;int&gt;(detectionResults.at&lt;float&gt;(i, 2));
                 int height  = static_cast&lt;int&gt;(detectionResults.at&lt;float&gt;(i, 3));
 
+                if(qMin(X, Y) == std::numeric_limits&lt;int&gt;::min() || qMin(width, height) == std::numeric_limits&lt;int&gt;::min()) {
+                    qCWarning(DIGIKAM_FACESENGINE_LOG) &lt;&lt; &quot;Invalid detectionResults rect (INT_MIN) for image&quot; &lt;&lt; package-&gt;info.filePath();
+                    continue;
+                }
                 // Add the rect to result list.
 
                 faceFRects &lt;&lt; QRectF(qreal(X)      / qreal(cvUResizedImage.cols),

see https://discuss.kde.org/t/digikam-crashes-when-starting-to-scan-faces-with-qt6-error/43970/4?u=peta</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2505156</commentid>
    <comment_count>1</comment_count>
    <who name="">caulier.gilles</who>
    <bug_when>2026-03-21 12:13:02 +0000</bug_when>
    <thetext>Git commit 00d2dfc31eb90c392e11d77d1d35c91dff4df3e8 by Gilles Caulier.
Committed on 21/03/2026 at 12:10.
Pushed by cgilles into branch &apos;master&apos;.

Add patch to prevent crash overflow in face pipeline when values returned by OpenCV raise INT_MIN limit.
FIXED-IN: 9.1.0

M  +20   -0    core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp

https://invent.kde.org/graphics/digikam/-/commit/00d2dfc31eb90c392e11d77d1d35c91dff4df3e8</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>