SUMMARY When the video thumbnail cache contains invalid data, e.g. empty files, KPhotoAlbum crashes when the thumbnail view is active and the mouse hovers over the thumbnail. STEPS TO REPRODUCE 1. Have empty files in the .videoThumbnails directory inside the image directory (I don't know why these are created by KPA) 2. Start KPhotoAlbum and go to thumbnail view 3. Hover mouse over the thumbnail of a video that has empty video thumbnail frame files. OBSERVED RESULT KPhotoAlbum crashes. EXPECTED RESULT KPhotoAlbum does not crash. ADDITIONAL INFORMATION Backtrace and debug output: kphotoalbum.ImageManager: Thumbnail file ".videoThumbnails/fc51f8eeebacb368e77bfcbe06f0fc73-8" exists: true TGAHandler::canRead() error while reading the header kphotoalbum.ImageManager: Video thumbnail frame 8 for "2006/02-03.../cimg2408.avi" is on disk but empty. Thread 1 "kphotoalbum" received signal SIGSEGV, Segmentation fault. 0x00007ffff5b77dc4 in QImage::isNull() const () from /lib/x86_64-linux-gnu/libQt6Gui.so.6 (gdb) bt #0 0x00007ffff5b77dc4 in QImage::isNull() const () at /lib/x86_64-linux-gnu/libQt6Gui.so.6 #1 0x00005555556a0c48 in ImageManager::VideoThumbnails::requestNext (this=0x555575b3ced0) at /home/zing/Projects/kde/kphotoalbum/ImageManager/VideoThumbnails.cpp:71 #2 0x000055555560bc22 in ThumbnailView::MouseTrackingInteraction::mouseMoveEvent (this=<optimized out>, event=<optimized out>) at /home/zing/Projects/kde/kphotoalbum/ThumbnailView/MouseTrackingInteraction.cpp:29 #3 0x000055555560bf0a in non-virtual thunk to ThumbnailView::MouseTrackingInteraction::mouseMoveEvent(QMouseEvent*) () #4 0x00005555556058b0 in ThumbnailView::ThumbnailWidget::mouseMoveEvent (this=0x555575b36a30, event=0x0) at /home/zing/Projects/kde/kphotoalbum/ThumbnailView/ThumbnailWidget.cpp:170 #5 0x00007ffff63fecaf in QWidget::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6 #6 0x00007ffff6490bc4 in QFrame::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6 #7 0x00007ffff5585e1a in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt6Core.so.6 #8 0x00007ffff63b2092 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6 #9 0x00007ffff63b6c10 in QApplication::notify(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6 #10 0x00007ffff5587928 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt6Core.so.6 #11 0x00007ffff63ab4be in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6 #12 0x00007ffff6412488 in ??? () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6 #13 0x00007ffff6415838 in ??? () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6 #14 0x00007ffff63b20a2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6 #15 0x00007ffff5587928 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt6Core.so.6 #16 0x00007ffff5bc935b in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /lib/x86_64-linux-gnu/libQt6Gui.so.6 #17 0x00007ffff5c22a1c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt6Gui.so.6 #18 0x00007ffff5f66b34 in ??? () at /lib/x86_64-linux-gnu/libQt6Gui.so.6 #19 0x00007ffff2bd181f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #20 0x00007ffff2bd3a57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #21 0x00007ffff2bd41c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #22 0x00007ffff578c473 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt6Core.so.6 #23 0x00007ffff5592adb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt6Core.so.6 #24 0x00007ffff558a908 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt6Core.so.6 #25 0x00005555555d641c in main (argc=1, argv=<optimized out>) at /home/zing/Projects/kde/kphotoalbum/main.cpp:156 (gdb) quit
Posssible duplicate of bug #497163
Git commit 00db51b4cfef6d233804c23983d64d9bc3e75cfc by Johannes Zarl-Zierl. Committed on 23/12/2024 at 15:20. Pushed by johanneszarl into branch 'master'. Fix crash when video thumbnail cache contains empty files Note: this fixes the resulting crash, but not the cause of the empty files. M +17 -0 CHANGELOG.md M +6 -2 ImageManager/VideoThumbnails.cpp M +2 -2 lib/kpathumbnails/VideoThumbnailCache.cpp M +2 -0 lib/kpathumbnails/VideoThumbnailCache.h https://invent.kde.org/graphics/kphotoalbum/-/commit/00db51b4cfef6d233804c23983d64d9bc3e75cfc