Bug 15142

Summary: GIFImageDecoder can lie about frame count
Product: WebKit Reporter: Peter Kasting <pkasting>
Component: ImagesAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
patch v1 mjs: review+

Description Peter Kasting 2007-09-04 12:01:26 PDT
WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp (not used by Safari, but used by Cairo/QT) has an API safety issue in frameBufferAtIndex(): it assumes the frame count has already been decoded, so it just returns the size of the internal frame buffer.  But if a caller calls this function when the decoder has received more data since its last decode (or since ever, if nothing has forced the decoder to start decoding), this value is out of date.

The fix is easy: just call the existing frameCount() function which determines if the count is up to date and recalculates it if not.

Patch coming shortly.
Comment 1 Peter Kasting 2007-09-04 12:06:49 PDT
Created attachment 16199 [details]
patch v1

Simple fix
Comment 2 Maciej Stachowiak 2007-09-29 18:12:34 PDT
Comment on attachment 16199 [details]
patch v1

r=me
Comment 3 Eric Seidel (no email) 2007-10-07 01:38:59 PDT
Is this for feature-branch or trunk?  I don't know where qt development is going on these days.
Comment 4 Mark Rowe (bdash) 2007-10-14 04:36:59 PDT
Landed in r26579.