Skip to content

Fix null dereference on error in iOS CameraDevice#1649

Merged
CedricGuillemet merged 2 commits intoBabylonJS:masterfrom
CedricGuillemet:fixiosCameraErrorMessage
Mar 26, 2026
Merged

Fix null dereference on error in iOS CameraDevice#1649
CedricGuillemet merged 2 commits intoBabylonJS:masterfrom
CedricGuillemet:fixiosCameraErrorMessage

Conversation

@CedricGuillemet
Copy link
Copy Markdown
Contributor

@CedricGuillemet CedricGuillemet commented Mar 26, 2026

The error variable passed to RenderPipelineStateWithDescriptor may be nil even when the call fails. This guards against dereferencing nil when building the error message string.

Guard against nil error variable when creating camera pipeline state
error message. If error is nil, append empty string instead of
dereferencing nil.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 26, 2026 15:40
@CedricGuillemet CedricGuillemet enabled auto-merge (squash) March 26, 2026 15:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Guards against a nil NSError* being dereferenced when newRenderPipelineStateWithDescriptor:error: fails on iOS, improving robustness of CameraDevice::OpenAsync initialization.

Changes:

  • Add a nil-check around error.localizedDescription usage when constructing the pipeline creation failure message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@CedricGuillemet CedricGuillemet merged commit 887a044 into BabylonJS:master Mar 26, 2026
27 checks passed
CedricGuillemet added a commit to CedricGuillemet/BabylonReactNative that referenced this pull request Mar 26, 2026
Update BabylonNative commit reference to pick up the fix for null
dereference on error in iOS CameraDevice (BabylonJS/BabylonNative#1649).

The error variable passed to newRenderPipelineStateWithDescriptor may
be nil even when the call fails. The new commit guards against
dereferencing nil when building the error message string.

Also includes:
- MSVC /MP multiprocessor build flag (BabylonJS/BabylonNative#1644)
- bgfx update for x86 crash fix (BabylonJS/BabylonNative#1643)
- Crash dump collection on all CI platforms (BabylonJS/BabylonNative#1641)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CedricGuillemet added a commit to BabylonJS/BabylonReactNative that referenced this pull request Mar 27, 2026
Update BabylonNative commit reference to pick up the fix for null
dereference on error in iOS CameraDevice (BabylonJS/BabylonNative#1649).

The error variable passed to newRenderPipelineStateWithDescriptor may
be nil even when the call fails. The new commit guards against
dereferencing nil when building the error message string.

Also includes:
- MSVC /MP multiprocessor build flag (BabylonJS/BabylonNative#1644)
- bgfx update for x86 crash fix (BabylonJS/BabylonNative#1643)
- Crash dump collection on all CI platforms (BabylonJS/BabylonNative#1641)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants