[Webkit-unassigned] [Bug 187582] Image is unexpectedly decoded

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 12 00:12:54 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=187582

--- Comment #1 from Yoshiaki Jitsukawa <yoshiaki.jitsukawa at sony.com> ---
I thought the "return m_decoder->size();" code would be taken:

IntSize ImageSource::size()
{
#if !USE(CG)
    // It's possible that we have decoded the metadata, but not frame contents yet. In that case ImageDecoder claims to
    // have the size available, but the frame cache is empty. Return the decoder size without caching in such case.
    if (m_frames.isEmpty() && isDecoderAvailable())
        return m_decoder->size();
#endif
    return frameMetadataAtIndexCacheIfNeeded<IntSize>(0, (&ImageFrame::size), &m_size, ImageFrame::Caching::Metadata, SubsamplingLevel::Default);
}

but actually m_frames was not empty because dataChanged() added a frame by
growFrames() when EncodedDataStatus got to SizeAvailable

EncodedDataStatus ImageSource::dataChanged(SharedBuffer* data, bool allDataReceived)
{
    setData(data, allDataReceived);
    clearMetadata();
    EncodedDataStatus status = encodedDataStatus();
    if (status >= EncodedDataStatus::SizeAvailable)
        growFrames();
    return status;
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180712/cf5ee150/attachment.html>


More information about the webkit-unassigned mailing list