Changeset 223564 in webkit


Ignore:
Timestamp:
Oct 17, 2017 11:53:52 AM (7 years ago)
Author:
jer.noble@apple.com
Message:

Corrupted image after looping movie-backed <img>.
https://bugs.webkit.org/show_bug.cgi?id=178398

Reviewed by Eric Carlson.

Use the decode-order sample cursor rather than the destination sample cursor when generating
the CMSampleBuffer to decode.

  • platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:

(WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r223563 r223564  
     12017-10-17  Jer Noble  <jer.noble@apple.com>
     2
     3        Corrupted image after looping movie-backed <img>.
     4        https://bugs.webkit.org/show_bug.cgi?id=178398
     5
     6        Reviewed by Eric Carlson.
     7
     8        Use the decode-order sample cursor rather than the destination sample cursor when generating
     9        the CMSampleBuffer to decode.
     10
     11        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
     12        (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
     13
    1142017-10-17  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm

    r223560 r223564  
    590590        auto presentationTime = PAL::toMediaTime(m_cursor.get().presentationTimeStamp);
    591591        auto indexIter = m_presentationTimeToIndex.find(presentationTime);
    592         advanceCursor();
    593592
    594593        if (indexIter == m_presentationTimeToIndex.end())
    595             return nullptr;
     594            break;
    596595
    597596        auto& cursorSampleData = m_sampleData[indexIter->second];
    598597
    599598        if (!cursorSampleData.sample) {
    600             auto request = adoptNS([allocAVSampleBufferRequestInstance() initWithStartCursor:frameCursor]);
     599            auto request = adoptNS([allocAVSampleBufferRequestInstance() initWithStartCursor:m_cursor.get()]);
    601600            cursorSampleData.sample = adoptCF([m_generator createSampleBufferForRequest:request.get()]);
    602601        }
    603602
    604603        if (!cursorSampleData.sample)
    605             return nullptr;
     604            break;
    606605
    607606        if (!storeSampleBuffer(cursorSampleData.sample.get()))
    608             return nullptr;
    609 
     607            break;
     608
     609        advanceCursor();
    610610        if (sampleData.image)
    611611            return sampleData.image;
    612612    }
    613613
    614     ASSERT_NOT_REACHED();
     614    advanceCursor();
    615615    return nullptr;
    616616}
Note: See TracChangeset for help on using the changeset viewer.