Commit 5423b9c2 authored by aroben@apple.com's avatar aroben@apple.com
Browse files

Fix a CFData leak in MediaPlayerPrivateQuickTimeVisualContext

Fixes <http://webkit.org/b/39432> <rdar://problem/8008992>

Reviewed by Ada Chan

* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::QTCFDictionaryCreateWithDataCallback): Use a RetainPtr to
hold the CFData we allocate so it will get released when this function
is exited. Also pass kCFAllocatorNull as the bytes deallocator to
CFDataCreateWithBytesNoCopy so that CF doesn't try to deallocate the
bytes we pass to it.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3c25fb48
2010-05-20 Adam Roben <aroben@apple.com>
Fix a CFData leak in MediaPlayerPrivateQuickTimeVisualContext
Fixes <http://webkit.org/b/39432> <rdar://problem/8008992>
Reviewed by Ada Chan
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::QTCFDictionaryCreateWithDataCallback): Use a RetainPtr to
hold the CFData we allocate so it will get released when this function
is exited. Also pass kCFAllocatorNull as the bytes deallocator to
CFDataCreateWithBytesNoCopy so that CF doesn't try to deallocate the
bytes we pass to it.
2010-05-20 Jian Li <jianli@chromium.org>
 
Reviewed by David Levin.
......@@ -659,11 +659,11 @@ void MediaPlayerPrivateQuickTimeVisualContext::visualContextTimerFired(Timer<Med
static CFDictionaryRef QTCFDictionaryCreateWithDataCallback(CFAllocatorRef allocator, const UInt8* bytes, CFIndex length)
{
CFDataRef data = CFDataCreateWithBytesNoCopy(allocator, bytes, length, 0);
RetainPtr<CFDataRef> data(AdoptCF, CFDataCreateWithBytesNoCopy(allocator, bytes, length, kCFAllocatorNull));
if (!data)
return 0;
return reinterpret_cast<CFDictionaryRef>(CFPropertyListCreateFromXMLData(allocator, data, kCFPropertyListImmutable, 0));
return reinterpret_cast<CFDictionaryRef>(CFPropertyListCreateFromXMLData(allocator, data.get(), kCFPropertyListImmutable, 0));
}
static CGImageRef CreateCGImageFromPixelBuffer(QTPixelBuffer buffer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment