MarshallOfSound

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

Merged
Created: Mar 25, 2026, 2:16:24 AM
Merged: Mar 25, 2026, 12:47:00 PM
5 comments
Target: main

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

This PR adds a null check and returns an empty gfx::Image instead, matching the existing pattern in shell/common/skia_util.cc.

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

Backports

39-x-y
Merged
PR Number
#50493
Merged At
Mar 26, 2026, 12:16:26 AM
Released In
v39.8.5
Release Date
Mar 26, 2026, 6:06:36 PM
40-x-y
Merged
PR Number
#50491
Merged At
Mar 26, 2026, 1:25:39 AM
Released In
v40.8.5
Release Date
Mar 26, 2026, 3:21:16 PM
41-x-y
Merged
PR Number
#50492
Merged At
Mar 26, 2026, 12:15:59 AM
Released In
v41.1.0
Release Date
Mar 26, 2026, 3:53:32 PM
42-x-y
Merged
PR Number
#50494
Merged At
Mar 26, 2026, 1:22:43 AM
Released In
v42.0.0-alpha.5
Release Date
Mar 26, 2026, 1:38:47 PM

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron