Bug 301482

Summary: Null deref in CMUtilities' toCMSampleBuffer
Product: WebKit Reporter: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Component: MediaAssignee: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Jean-Yves Avenard [:jya]
Reported 2025-10-26 02:23:50 PDT
Last minute change introduced a null dereference if the sample doesn't contain any attachment. ``` RetainPtr attachmentsArray = PAL::CMSampleBufferGetSampleAttachmentsArray(rawSampleBuffer, false); if (!attachmentsArray || static_cast<size_t>(CFArrayGetCount(attachmentsArray.get())) < samples.size()) { RELEASE_LOG_DEBUG(Media, "Encrypted sample doesn't contain sufficient attachments: %u (expected:%u)", static_cast<unsigned>(CFArrayGetCount(attachmentsArray.get()), static_cast<unsigned>(samples.size())); return adoptCF(rawSampleBuffer); } ``` if `attachmentsArray` is null, CFArrayGetCount will cause a dereference of 0.
Attachments
Radar WebKit Bug Importer
Comment 1 2025-10-26 03:42:05 PDT
Jean-Yves Avenard [:jya]
Comment 2 2025-10-26 03:45:46 PDT
EWS
Comment 3 2025-10-26 15:12:04 PDT
Committed 302168@main (f12eb6a08e4b): <https://commits.webkit.org/302168@main> Reviewed commits have been landed. Closing PR #53008 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.