DescriptionFix caching bug in JPEGImageDecoder
When decoding only the size, update the restart position and clear
jpeg_source_mgr's bytes_in_buffer and next_input_byte. If m_data gets
collapsed (outside of JPEGImageDecoder), these values may no longer be
valid, since they may point into a segment which no longer exists.
The next call to decode will be forced to call getSomeData from the
restart position.
Add a test which fails without the fix. While the fix does not depend
on intimate knowledge of the implementation of SharedBuffer, the test
does. In order to ensure that the data in the SharedBuffer gets freed,
insert the data into the SharedBuffer using
void append(const char*, unsigned)
with a length > kSegmentSize, which will force the SharedBuffer to
skip its PurgeableVector (m_buffer). After letting JPEGImageDecoder
cache a pointer into the SharedBuffer (by calling isSizeAvailable()),
collapse the data with a call to data().
BUG=467772
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=202632
Patch Set 1 #
Total comments: 7
Patch Set 2 : Respond to pkasting's comments in patch set 1 #
Messages
Total messages: 8 (3 generated)
|