Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setSampleBufferAsDisplayImmediately should check that attachment array is not null #18563

Conversation

youennf
Copy link
Contributor

@youennf youennf commented Oct 3, 2023

53867c1

setSampleBufferAsDisplayImmediately should check that attachment array is not null
https://bugs.webkit.org/show_bug.cgi?id=262556
rdar://115712997

Reviewed by Brent Fulgham.

CMSampleBufferGetSampleAttachmentsArray may return a null attachment array even if createIfNecessary = true, in case of error.
In that case, make sure setSampleBufferAsDisplayImmediately bails out early.

* Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
(WebCore::setSampleBufferAsDisplayImmediately):

Canonical link: https://commits.webkit.org/268802@main

865aa24

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🛠 gtk
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2
✅ 🛠 tv-sim
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@youennf youennf self-assigned this Oct 3, 2023
@youennf youennf added the WebRTC For bugs in WebRTC label Oct 3, 2023
Copy link
Contributor

@brentfulgham brentfulgham left a comment

Choose a reason for hiding this comment

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

Looks like a reasonable nullptr check. r=me

@@ -357,6 +357,8 @@ static void runWithoutAnimations(const WTF::Function<void()>& function)
static void setSampleBufferAsDisplayImmediately(CMSampleBufferRef sampleBuffer)
{
CFArrayRef attachmentsArray = PAL::CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, true);
if (!attachmentsArray)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to check the validity of sampleBuffer as well?

@brentfulgham brentfulgham added the merge-queue Applied to send a pull request to merge-queue label Oct 3, 2023
…y is not null

https://bugs.webkit.org/show_bug.cgi?id=262556
rdar://115712997

Reviewed by Brent Fulgham.

CMSampleBufferGetSampleAttachmentsArray may return a null attachment array even if createIfNecessary = true, in case of error.
In that case, make sure setSampleBufferAsDisplayImmediately bails out early.

* Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
(WebCore::setSampleBufferAsDisplayImmediately):

Canonical link: https://commits.webkit.org/268802@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/setSampleBufferAsDisplayImmediately-should-check-that-attachment-array-is-not-null branch from 865aa24 to 53867c1 Compare October 3, 2023 21:27
@webkit-commit-queue
Copy link
Collaborator

Committed 268802@main (53867c1): https://commits.webkit.org/268802@main

Reviewed commits have been landed. Closing PR #18563 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 53867c1 into WebKit:main Oct 3, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebRTC For bugs in WebRTC
Projects
None yet
4 participants