SIGN IN SIGN UP
obsproject / obs-studio UNCLAIMED

OBS Studio - Free and open source software for live streaming and screen recording

0 0 119 C

mac-avcapture: Fix crash issues on Intel-based Macs and older macOS

Fixes several possible crash issues that might occur on Intel-based Macs
and older macOS versions:

On modern macOS versions (13+) allocated memory is zero-allocated by
default which makes NULL pointer checks work correctly after allocation.

On older macOS versions this is not the case, so the OBSAVCaptureInfo
struct needs to be zero-allocated to ensure the guards in the tick and
render functions bail out correctly.

On Intel-based Macs and/or older macOS versions passing a reference to
the OBSAVCapture instance inside the OBSAVCapture struct can lead to a
crash because of a possible circular reference that cannot be resolved
at runtime.

Passing only a reference of the OBSAVCapture to libobs and incrementing
the retain count at source creation (decrementing in when the source is
destroyed) avoids this issue entirely.
P
PatTheMav committed
03c42e5b9300a45b3d46e900aba08596a223b43f
Parent: a63714c
Committed by Ryan Foster <ryan@obsproject.com> on 2/20/2024, 10:57:09 PM