Leak of one AVSampleCursor inside ImageDecoderAVFObjC::createFrameImageAtIndex()
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Oct 2017 18:33:21 +0000 (18:33 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Oct 2017 18:33:21 +0000 (18:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178397

Reviewed by Eric Carlson.

Explicitly wrap the return value of -copy in a RetainPtr.

* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223560 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm

index e0bfc06..edbdf27 100644 (file)
@@ -1,3 +1,15 @@
+2017-10-17  Jer Noble  <jer.noble@apple.com>
+
+        Leak of one AVSampleCursor inside ImageDecoderAVFObjC::createFrameImageAtIndex()
+        https://bugs.webkit.org/show_bug.cgi?id=178397
+
+        Reviewed by Eric Carlson.
+
+        Explicitly wrap the return value of -copy in a RetainPtr.
+
+        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
+        (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
+
 2017-10-17  Youenn Fablet  <youenn@apple.com>
 
         Cache API implementation should be able to compute storage size for WebKit client applications.
index 3fa1562..084d642 100644 (file)
@@ -571,7 +571,7 @@ NativeImagePtr ImageDecoderAVFObjC::createFrameImageAtIndex(size_t index, Subsam
     auto frameCursor = [m_track makeSampleCursorWithPresentationTimeStamp:PAL::toCMTime(sampleData.presentationTime)];
     if ([frameCursor comparePositionInDecodeOrderWithPositionOfCursor:m_cursor.get()] == NSOrderedAscending)  {
         // Rewind cursor to the last sync sample to begin decoding
-        m_cursor = [frameCursor copy];
+        m_cursor = adoptNS([frameCursor copy]);
         do {
             if ([m_cursor currentSampleSyncInfo].sampleIsFullSync)
                 break;