Skip to content

fix: crash in clipboard.readImage() on malformed image data#50494

Merged
dsanders11 merged 1 commit into42-x-yfrom
trop/42-x-y-bp-fix-crash-in-clipboard-readimage-on-malformed-image-data-1774460832923
Mar 26, 2026
Merged

fix: crash in clipboard.readImage() on malformed image data#50494
dsanders11 merged 1 commit into42-x-yfrom
trop/42-x-y-bp-fix-crash-in-clipboard-readimage-on-malformed-image-data-1774460832923

Conversation

@trop
Copy link
Copy Markdown
Contributor

@trop trop bot commented Mar 25, 2026

Backport of #50475

See that PR for details.

Notes: Fixed a crash in clipboard.readImage() when the clipboard contains malformed image data.

gfx::PNGCodec::Decode() returns a null SkBitmap when it fails to decode
the clipboard contents as a PNG. Passing that null bitmap to
gfx::Image::CreateFrom1xBitmap() triggers a crash.

Return an empty gfx::Image instead, matching the existing null-check
pattern in skia_util.cc.

Co-authored-by: Sam Attard <sattard@anthropic.com>
@trop trop bot requested review from a team and MarshallOfSound March 25, 2026 17:47
@trop trop bot added 42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Mar 25, 2026
@dsanders11 dsanders11 merged commit a806e38 into 42-x-y Mar 26, 2026
167 of 170 checks passed
@dsanders11 dsanders11 deleted the trop/42-x-y-bp-fix-crash-in-clipboard-readimage-on-malformed-image-data-1774460832923 branch March 26, 2026 06:22
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Mar 26, 2026

Release Notes Persisted

Fixed a crash in clipboard.readImage() when the clipboard contains malformed image data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants