Bug 497994 - Krfb crashes on start after "Remote control requested" dialog
Summary: Krfb crashes on start after "Remote control requested" dialog
Status: REPORTED
Alias: None
Product: krfb
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.08.3
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: George Goldberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-28 18:45 UTC by Ivan Savu
Modified: 2024-12-28 19:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Savu 2024-12-28 18:45:47 UTC
SUMMARY
Krfb segfaults immediately after clicking "Share" in the "Remote control requested" dialog on start. The backtrace points to krfb-24.08.3/framebuffers/pipewire:377.

The relevant code is as follows:

// FIXME: Assuming stride == width * 4, not sure to which extent this holds
setVideoSize(frame.dataFrame->size);
memcpy(q->fb, frame.dataFrame->data, frame.dataFrame->size.width() * frame.dataFrame->stride);

It seems there might be an issue with the calculation of the framebuffer size. If stride equals width * 4, then the current code appears to multiply width twice (width*stride). As a test, I changed the calculation to use size.height()*stride instead, and this modification appears to resolve the issue, though I am not certain this is the correct solution or explanation.

STEPS TO REPRODUCE
1. Launch Krfb.
2. Click "Share" when the "Remote control requested" dialog appears.

OBSERVED RESULT
Krfb segfaults immediately after clicking "Share."

EXPECTED RESULT
The application should proceed to share the screen without crashing.

SOFTWARE/OS VERSIONS
Windows: N/A
macOS: N/A
Linux/KDE Plasma: 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.3

ADDITIONAL INFORMATION
Pipewire version 1.2.6