Changeset 231920 in webkit


Ignore:
Timestamp:
May 17, 2018 2:02:23 PM (6 years ago)
Author:
jer.noble@apple.com
Message:

CRASH in ImageDecoderAVFObjC::sampleAtIndex()
https://bugs.webkit.org/show_bug.cgi?id=185734
<rdar://problem/40295094>

Reviewed by Eric Carlson.

Source/WebCore:

Test: fast/images/animated-image-mp4-crash.html

Test the correct size value before iterating over the SampleMap in presentationOrder()

  • Modules/mediasource/SampleMap.h:

(WebCore::PresentationOrderSampleMap::size const):

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

(WebCore::ImageDecoderAVFObjC::sampleAtIndex const):

LayoutTests:

  • fast/images/animated-image-mp4-crash-expected.txt: Added.
  • fast/images/animated-image-mp4-crash.html: Added.
  • fast/images/resources/two-samples-with-same-pts.mp4: Added.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r231918 r231920  
     12018-05-17  Jer Noble  <jer.noble@apple.com>
     2
     3        CRASH in ImageDecoderAVFObjC::sampleAtIndex()
     4        https://bugs.webkit.org/show_bug.cgi?id=185734
     5        <rdar://problem/40295094>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * fast/images/animated-image-mp4-crash-expected.txt: Added.
     10        * fast/images/animated-image-mp4-crash.html: Added.
     11        * fast/images/resources/two-samples-with-same-pts.mp4: Added.
     12
    1132018-05-17  Youenn Fablet  <youenn@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r231915 r231920  
     12018-05-17  Jer Noble  <jer.noble@apple.com>
     2
     3        CRASH in ImageDecoderAVFObjC::sampleAtIndex()
     4        https://bugs.webkit.org/show_bug.cgi?id=185734
     5        <rdar://problem/40295094>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Test: fast/images/animated-image-mp4-crash.html
     10
     11        Test the correct size value before iterating over the SampleMap in presentationOrder()
     12
     13        * Modules/mediasource/SampleMap.h:
     14        (WebCore::PresentationOrderSampleMap::size const):
     15        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
     16        (WebCore::ImageDecoderAVFObjC::sampleAtIndex const):
     17
    1182018-05-17  Wenson Hsieh  <wenson_hsieh@apple.com>
    219
  • trunk/Source/WebCore/Modules/mediasource/SampleMap.h

    r229893 r231920  
    5454    reverse_iterator rend() { return m_samples.rend(); }
    5555    const_reverse_iterator rend() const { return m_samples.rend(); }
     56
     57    size_t size() const { return m_samples.size(); }
    5658
    5759    WEBCORE_EXPORT iterator findSampleWithPresentationTime(const MediaTime&);
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm

    r231179 r231920  
    671671const ImageDecoderAVFObjCSample* ImageDecoderAVFObjC::sampleAtIndex(size_t index) const
    672672{
    673     if (index >= m_sampleData.size())
     673    if (index >= m_sampleData.presentationOrder().size())
    674674        return nullptr;
    675675
     
    680680    for (size_t i = 0; i != index; ++i)
    681681        ++iter;
    682    
     682
    683683    return toSample(iter);
    684684}
Note: See TracChangeset for help on using the changeset viewer.