Bug 339811 - Crash occurring when browsing my images, resolved issue to thumbnailcreator.cpp trying to access non-present preview
Summary: Crash occurring when browsing my images, resolved issue to thumbnailcreator.c...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Thumbs-Engine (show other bugs)
Version: 4.3.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-09 11:21 UTC by Pierre Dumuid
Modified: 2019-08-15 15:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Dumuid 2014-10-09 11:21:55 UTC
I recently was browsing my images, and came across a folder where suddenly digikam crashed.

After running digikam through kdbg, I resolved that the problem was that a preview image was being attempted to be retrieved when one didn't exist!  Unfortunately, KExiv2Iface::KExiv2Previews doesn't throw an exception when the index passed to the call to image() exceeds the number of previews present.

 in the following file:
digikam-4.3.0/core/libs/threadimageio/thumbnailcreator.cpp

--- ./digikam-4.3.0/core/libs/threadimageio/thumbnailcreator.cpp        2014-09-11 23:38:57.000000000 +0930
+++ /tmp/digikam-4.3.0--core-libs-threadimageio-thumbnailcreator.cpp    2014-10-09 21:41:18.346518663 +1030
@@ -525,7 +525,9 @@
             kDebug() << "Trying to load Embedded preview with Exiv2";
 
             KExiv2Iface::KExiv2Previews preview(path);
-            qimage = preview.image();
+            if (preview.count() > 0) {
+                qimage = preview.image();
+            }
         }

Before this change, browsing the specific folder crashed digikam everytime.  After the above change, I haven't had it crash..


Reproducible: Always
Comment 1 caulier.gilles 2014-10-09 11:30:53 UTC
This is already fixed in 4.4.0 release.

See bug #339144

Gilles Caulier

*** This bug has been marked as a duplicate of bug 339144 ***
Comment 2 Pierre Dumuid 2014-10-09 11:35:56 UTC
Sorry, I thought I was on the latest version of digikam, since there's no news feed past 4.3.0. I'll compile 4.4.0 and see how I go!
Comment 3 caulier.gilles 2019-08-15 15:24:38 UTC
Fixed with bug #339144