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

Jean-Baptiste Mardelle <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://invent.kde.org/mult |https://invent.kde.org/mult
                   |imedia/kdenlive/-/commit/bb |imedia/kdenlive/-/commit/d5
                   |bb011eedd8811c1cfd421deac40 |54aabbb35ab8d8d3ccdb60d968f
                   |65d7d869961                 |2a3854223b6

--- Comment #8 from Jean-Baptiste Mardelle <[email protected]> ---
Git commit d554aabbb35ab8d8d3ccdb60d968f2a3854223b6 by Jean-Baptiste Mardelle,
on behalf of Jason Ross.
Committed on 19/11/2026 at 14:36.
Pushed by mardelle into branch 'release/26.12'.

fix(crash): Use after free bug on Whisper model download when dialog box closed
before...

fix(crash): Use after free bug on Whisper model download when dialog box closed
before download and hashing completed

Moves the handler for `itemMatch`, which is the signal the hash check worker
sends with the file check result onto the GUI thread and ensures that the box
will wait for the download to complete or fail before closing, preventing a
crash. The GUI thread in its `connect()` call lacked context of what the
handler was doing, which made the handler run directly on a worker thread. From
there it changed the list widget, deleted mismatched models, and called
`accept()`, all outside the GUI thread, causing the use after free bug and
crash. Adding a `this` context object queues the handler onto the GUI thread. 

I chose to let the hash check complete rather than canceling the check in case
the user interacts with the close button and closes the dialog by accident. 
Before, it would cut the check short. A check cut short can't be reported as a
mismatch, because a mismatch deletes the model. Waiting also means a mismatched
model is deleted/removed as intended. The tradeoff is for now that the GUI
freezes until the hash check is complete.

 A future UI/UX improvement might be allowing the hashing check to separate its
operations from the dialog thread so it can continue when the dialog closes.  I
have some ideas that direction and am happy to provide separately if that is
wanted.

Disclosure - I did use a LLM in the process of creating this fix.

M  +20   -9    src/pythoninterfaces/dialogs/whisperdownload.cpp
M  +6    -3    src/pythoninterfaces/dialogs/whisperdownload.h

https://invent.kde.org/multimedia/kdenlive/-/commit/d554aabbb35ab8d8d3ccdb60d968f2a3854223b6

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

Reply via email to