Skip to content
Permalink
Browse files
com.apple.WebKit.GPU leaks CMBlockBuffer
https://bugs.webkit.org/show_bug.cgi?id=240267
rdar://92655222

Patch by Jean-Yves Avenard <jean-yves.avenard@apple.com> on 2022-05-09
Reviewed by Jer Noble.

* platform/graphics/cocoa/CMUtilities.mm:
(WebCore::toCMSampleBuffer): adopt newly created CMBlockBuffer rather than increase the refcount.

# Please populate the above commit message. Lines starting
# with '#' will be ignored

# com.apple.WebKit.GPU leaks CMBlockBuffer
# https://bugs.webkit.org/show_bug.cgi?id=240267
# rdar://92655222
#
# Reviewed by Jer Noble.
#
# * platform/graphics/cocoa/CMUtilities.mm:
# (WebCore::toCMSampleBuffer): adopt newly created CMBlockBuffer rather than increase the refcount.

# On branch bz/240267
# Your branch is ahead of 'origin/main' by 1 commit.
#   (use "git push" to publish your local commits)
#
# Changes to be committed:
#   (use "git restore --staged <file>..." to unstage)
# 	modified:   Source/WebCore/ChangeLog
#

# Please populate the above commit message. Lines starting
# with '#' will be ignored

# On branch bz/240267
# Your branch is ahead of 'origin/main' by 1 commit.
#   (use "git push" to publish your local commits)
#
# nothing to commit, working tree clean

Canonical link: https://commits.webkit.org/250440@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294004 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jyavenard authored and webkit-commit-queue committed May 10, 2022
1 parent af1cbea commit 08e5e85be5e2b5700494c3c01651da1488c9d29e
Showing with 12 additions and 1 deletion.
  1. +11 −0 Source/WebCore/ChangeLog
  2. +1 −1 Source/WebCore/platform/graphics/cocoa/CMUtilities.mm
@@ -1,3 +1,14 @@
2022-05-09 Jean-Yves Avenard <jya@apple.com>

com.apple.WebKit.GPU leaks CMBlockBuffer
https://bugs.webkit.org/show_bug.cgi?id=240267
rdar://92655222

Reviewed by Jer Noble.

* platform/graphics/cocoa/CMUtilities.mm:
(WebCore::toCMSampleBuffer): adopt newly created CMBlockBuffer rather than increase the refcount.

2022-05-09 Rob Buis <rbuis@igalia.com>

Check if node is connected after calling mergeWithNeighboringLists
@@ -223,7 +223,7 @@ static CFStringRef convertToCMYCbCRMatrix(PlatformVideoMatrixCoefficients coeffi
auto err = PAL::CMBlockBufferCreateEmpty(kCFAllocatorDefault, samples.size(), 0, &rawBlockBuffer);
if (err != kCMBlockBufferNoErr || !rawBlockBuffer)

This comment has been minimized.

Copy link
@darinadler

darinadler May 10, 2022

Member

We check err here, and if it indicates an error, we don’t look at the value of rawBlockBuffer. But if rawBlockBuffer is non-null, then I think we have a storage leak. I suggest we don’t even bother looking at the error code, and make our decision entirely based on whether rawBlockBuffer is null or not, to make the logic here more obviously correct.

return makeUnexpected("CMBlockBufferCreateEmpty failed");
completeBlockBuffers = rawBlockBuffer;
completeBlockBuffers = adoptCF(rawBlockBuffer);
}

Vector<CMSampleTimingInfo> packetTimings;

0 comments on commit 08e5e85

Please sign in to comment.