Bug 58501 - Use HTMLImageElement in Canvas 2D / WebGL before response is ready causes crash
Summary: Use HTMLImageElement in Canvas 2D / WebGL before response is ready causes crash
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2011-04-13 18:38 PDT by Zhenyao Mo
Modified: 2011-06-18 12:49 PDT (History)
6 users (show)

See Also:

Patch (3.63 KB, patch)
2011-04-14 18:53 PDT, Zhenyao Mo
kbr: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zhenyao Mo 2011-04-13 18:38:35 PDT
This is because cachedImage()->response().url().string().impl() is null, and hash(null) is not expected, thus crash.
Comment 1 Zhenyao Mo 2011-04-13 18:39:19 PDT
I am working on a fix for WebGL.  If someone else more familiar with canvas 2d could fix this on the canvas 2d side, it would be great!
Comment 2 Zhenyao Mo 2011-04-13 18:42:42 PDT
A test case for WebGL: 

svn checkout https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl
-r 14468


Current behavior: crash

correct behavior: no crash
Comment 3 Zhenyao Mo 2011-04-14 18:53:06 PDT
Created attachment 89716 [details]
Comment 4 Zhenyao Mo 2011-04-14 18:54:49 PDT
This patch makes sure WebGL won't process an HTMLImageElement if it's not ready yet.

mdelaney is getting another patch ready for the rest.
Comment 5 Kenneth Russell 2011-04-15 10:33:05 PDT
Comment on attachment 89716 [details]

Looks good.
Comment 6 Zhenyao Mo 2011-04-15 11:02:12 PDT
Committed r83992: <http://trac.webkit.org/changeset/83992>