[digikam] [Bug 524393] New: Crash when dragging image in library to re-position it

Graham <[email protected]>
Newsgroups gmane.comp.kde.devel.bugs
Message-ID <[email protected]/>
https://bugs.kde.org/show_bug.cgi?id=524393

            Bug ID: 524393
           Summary: Crash when dragging image in library to re-position it
    Classification: Applications
           Product: digikam
      Version First 9.2.0
       Reported In:
          Platform: Other
                OS: macOS
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 195233
  --> https://bugs.kde.org/attachment.cgi?id=195233&action=edit
Crash dump

DESCRIPTION
Dragging image in library to reorder sometimes results in crash

Summary -
Root cause: a crash inside Qt's macOS drag-image code path, triggered by an
invalid/corrupt colorspace object passed to CGImageCreate.

The crashing thread (thread 0, main thread) was in the middle of starting a
drag-and-drop operation:

Digikam::DragDropViewImplementation::startDrag
→ QDrag::exec / QDragManager::drag
→ -[NSWindow(NSDrag) dragImage:...]
→ QImage::toCGImage()
→ CGImageCreate → verify_image_parameters → valid_image_colorspace →
CGColorSpaceGetType → CFGetTypeID → __CF_IS_OBJC

Started dragging an item — A thumbnail in the icon/item view (DCategorizedView
/ ItemViewCategorized::mouseMoveEvent) — and Qt tried to build a CGImage for
the drag ghost image via QImage::toCGImage(). That function hands the image's
CGColorSpace to CGImageCreate. Core Graphics then tries to type-check that
colorspace object (CGColorSpaceGetType → CFGetTypeID), and the ARM64e
pointer-authentication check on it fails (esr: pointer authentication trap DA,
far: 0x0). That means the colorspace pointer being passed in isn't a valid,
live Objective-C/CoreFoundation object — it's garbage, null-ish, or already
freed. In short: the QImage being dragged has a corrupted/invalid color space,
and CGImageCreate traps trying to validate it.

Seems it's a bug in how digiKam (via Qt6) constructs the QImage used for the
drag thumbnail, most likely triggered by a specific image's embedded color
profile (e.g. a CMYK, unusual ICC, or 16-bit image) producing a QImage whose
internal colorSpace() is malformed by the time it's converted for the native
drag image.

OBSERVED RESULT
Crash

EXPECTED RESULT
Thumbnail moved

SOFTWARE/OS VERSIONS
MacOS 26.6


ADDITIONAL INFORMATION
Mac OS Crash dump added as attachment

-- 
You are receiving this mail because:
You are watching all bug changes.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.