https://bugs.kde.org/show_bug.cgi?id=516557

            Bug ID: 516557
           Summary: Segfault when loading COG TIFF file
    Classification: Applications
           Product: gwenview
      Version First 25.12.2
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 189977
  --> https://bugs.kde.org/attachment.cgi?id=189977&action=edit
MRE image file that causes the bug

SUMMARY
When loading a COG (Cloud Optimized GeoTIFF) file in Gwenview, it segfaults at
`fetchIndexedToARGB32PM<(QPixelLayout::BPP)3>` on the first row of pixels. 

The cause seems to be the `clut` parameter being null:
---
fetchIndexedToARGB32PM<(QPixelLayout::BPP)3> (buffer=0x7fffaa7fc650,
src=0x555556518a40 "", index=0, count=504, clut=0x0)
    at
/usr/src/debug/qt6-qtbase-6.10.1-3.fc43.x86_64/src/gui/painting/qpixellayout.cpp:774
774             buffer[i] = qPremultiply(clut->at(s))
---

STEPS TO REPRODUCE
1. Try loading the attached image file
2. Observe that the program segfaults

OBSERVED RESULT
Segmentation fault
Backtrace:
---
#0  fetchIndexedToARGB32PM<(QPixelLayout::BPP)3>
    (buffer=0x7fffaa7fc650, src=0x5555566bb090 "", index=0, count=504,
clut=0x0)
    at
/usr/src/debug/qt6-qtbase-6.10.1-3.fc43.x86_64/src/gui/painting/qpixellayout.cpp:774
#1  0x00007ffff5f5a69d in operator() (__closure=0x7fffffff8700,
cStart=<optimized out>, cEnd=<optimized out>)
    at
/usr/src/debug/qt6-qtbase-6.10.1-3.fc43.x86_64/src/gui/painting/qdrawhelper.cpp:4399
#2  0x00007ffff5f61135 in operator() (__closure=0x55555624a728)
    at
/usr/src/debug/qt6-qtbase-6.10.1-3.fc43.x86_64/src/gui/painting/qdrawhelper.cpp:4412
#3  QRunnable::QGenericRunnable::Helper<blend_untransformed_generic(int, const
QT_FT_Span*, void*)::<lambda()>
>::impl(QRunnable::QGenericRunnable::HelperBase::Op,
QRunnable::QGenericRunnable::HelperBase *, void *)
    (op=<optimized out>, that=0x55555624a720, arg=<optimized out>)
    at
/usr/src/debug/qt6-qtbase-6.10.1-3.fc43.x86_64/src/corelib/thread/qrunnable.h:74
#4  0x00007ffff522fa68 in QThreadPoolThread::run (this=0x555556223f90)
    at
/usr/src/debug/qt6-qtbase-6.10.1-3.fc43.x86_64/src/corelib/thread/qthreadpool.cpp:72
#5  0x00007ffff52d19ae in operator() (__closure=<optimized out>)
    at
/usr/src/debug/qt6-qtbase-6.10.1-3.fc43.x86_64/src/corelib/thread/qthread_unix.cpp:437
#6  (anonymous
namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> >
(t=<optimized out>)
    at
/usr/src/debug/qt6-qtbase-6.10.1-3.fc43.x86_64/src/corelib/thread/qthread_unix.cpp:367
#7  QThreadPrivate::start (arg=0x555556223f90)
--Type <RET> for more, q to quit, c to continue without paging--c
    at
/usr/src/debug/qt6-qtbase-6.10.1-3.fc43.x86_64/src/corelib/thread/qthread_unix.cpp:397
#8  0x00007ffff4a7f464 in start_thread (arg=<optimized out>) at
pthread_create.c:448
#9  0x00007ffff4b025ec in __GI___clone3 () at
../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
---
It looks like a BPP of 3 refers to 8 bits per pixel, which seems to be correct,
if it helps.

EXPECTED RESULT
The image loads and displays properly (at least as a standard 8BPP grayscale
image--I don't necessarily expect it to load the symbology/palette and
everything, though it would be convenient if it did).

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 43
KDE Plasma Version: 6.6.0
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.1
Kernel Version: 6.17.5-300.fc43.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 260 w/ Radeon 780M Graphics
Memory: 32 GiB of RAM (30.6 GiB usable)
Graphics Processor: AMD Radeon 780M Graphics
Manufacturer: LENOVO
Product Name: 83M0
System Version: Legion 5 15AHP10

ADDITIONAL INFORMATION
Krita and Okular load this image perfectly fine, even assigning the palette
colors and everything.
KolourPaint sometimes crashes and loads the image incorrectly, see #516556

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to