Summary: | Test that an image's size is valid before reading it. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Adam Langley <agl> | ||||||||
Component: | Images | Assignee: | Adam Langley <agl> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | eric, mrobinson, xan.lopez | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Attachments: |
|
Description
Adam Langley
2009-12-04 15:32:00 PST
Created attachment 44338 [details]
patch
(contains a binary file, so please don't cq+!)
Comment on attachment 44338 [details] patch > // Zero-height images can cause problems for some ports. If we have an > // empty image dimension, just bail. > - if (size().isEmpty()) > + if (isSizeAvailable() && size().isEmpty()) > return 0; This changes the logic. If the size is not available, this now continues and creates a native image. But the old code would return 0 if the size was not available. You should reverse the logic. if (!isSizeAvailable() || ... Created attachment 44503 [details]
patch
I originally thought that size() would return random memory in the case that it hadn't been set, but now I notice that it's constructed to 0, 0. So I've changed the logic as suggested.
Created attachment 44504 [details]
patch
Crap. Wrong patch. Corrected.
Attachment 44504 [details] was posted by a committer and has review+, assigning to Adam Langley for commit.
Comment on attachment 44504 [details]
patch
This can't be cq'd because it's missing the binary data.
This test seems to be (at least recently) crashing on Gtk. |