Bug 104302 - JPEGImageDecoder should use SharedBuffer::getSomeData() instead of data()
Summary: JPEGImageDecoder should use SharedBuffer::getSomeData() instead of data()
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-06 14:15 PST by Hin-Chung Lam
Modified: 2013-04-15 08:04 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hin-Chung Lam 2012-12-06 14:15:38 PST
JPEGImageDecoder calls data() to consolidate the entire buffer into one piece. This involves memcpys and can possibly avoided by using getSomeData().
Comment 1 noel gordon 2013-04-15 08:04:47 PDT
Noticed in the animated webp patch bug 113124, that a member variable m_demux (a webp demux object needed for decoding) is used to read the SharedBuffer::data(). 
The m_demux object internally maintains pointers into that data().

That's probably ok for a single pass through decode(). However, for progessive decoding of large webp images, decode() is called multiple times.  Any new calls SharedBuffer::data() in any decode() might cause that data() to be consolidated if I'm reading this bug correctly?