[Webkit-unassigned] [Bug 15097] New: PNGImageDecoder.cpp throws away data in some cases

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 27 17:38:46 PDT 2007


http://bugs.webkit.org/show_bug.cgi?id=15097

           Summary: PNGImageDecoder.cpp throws away data in some cases
           Product: WebKit
           Version: 522+ (nightly)
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Images
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: zerodpx at gmail.com


The code in PNGImageDecoder.cpp (not used for Safari Mac/Win, but used by
Cairo/QT) can throw away data when consumers call any decoding-related
functions on it before frameBufferAtIndex().

This is because the libpng code will only decode incoming data once (it
remembers it's already decoded the existing data when asked to decode it
again), and if no frame buffer is set up when it makes its callbacks, the
relevant data is simply discarded.  And the frame buffer vector isn't resized
to 1 frame (from 0) until frameBufferAtIndex() is called.

I don't see a good reason for this.  A single frame buffer entry takes up
almost no memory before the underlying RGBA32Buffer is set up, so there really
isn't a penalty for just sizing m_frameBufferCache to 1 in the constructor. 
This also saves some conditionals in various places that no longer need to
worry about whether this vector is empty.

Patch to fix coming shortly.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list