Opened 2 years ago

Closed 2 years ago

#18015 closed defect (fixed)

Mac: Fix crash due to CGDisplayModeCopyPixelEncoding returning NULL

Reported by: botg Owned by: Vadim Zeitlin <vadim@…>
Priority: normal Milestone:
Component: wxOSX Version: dev-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

It is possible for CGDisplayModeCopyPixelEncoding to return NULL, e.g. during a switch between the built-in screen and an external monitor on a Macbook.

The attached patches for both master and WX_3_0_BRANCH fix the crash by checking the return value of CGDisplayModeCopyPixelEncoding in wxDisplayDepth().

Attachments (2)

CGDisplayModeCopyPixelEncoding_master.diff download (1.8 KB) - added by botg 2 years ago.
Patch for master
CGDisplayModeCopyPixelEncoding_WX_3_0_BRANCH.diff download (1.9 KB) - added by botg 2 years ago.
Patch for WX_3_0_BRANCH

Download all attachments as: .zip

Change History (4)

Changed 2 years ago by botg

Patch for master

Changed 2 years ago by botg

Patch for WX_3_0_BRANCH

comment:1 Changed 2 years ago by Vadim Zeitlin <vadim@…>

In 6b75b2fdc/git-wxWidgets:

Fix crash when switching between monitors in wxOSX

It is possible for CGDisplayModeCopyPixelEncoding to return NULL, e.g.
during a switch between the built-in screen and an external monitor on a
Macbook. Check the return value to prevent a crash.

See #18015.

(cherry-pick of 26f48c225e3ac397ec1ba5de2e135d630dbc2e4b from master)

comment:2 Changed 2 years ago by Vadim Zeitlin <vadim@…>

  • Owner set to Vadim Zeitlin <vadim@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 26f48c225/git-wxWidgets:

Fix crash when switching between monitors in wxOSX

It is possible for CGDisplayModeCopyPixelEncoding to return NULL, e.g.
during a switch between the built-in screen and an external monitor on a
Macbook. Check the return value to prevent a crash.

Closes #18015.

Note: See TracTickets for help on using tickets.