Both should throw NOT_SUPPORTED_ERR when called with nonfinite arguments. getImageData() should throw INDEX_SIZE_ERR if either width or height is 0. (HTML5 spec 4.8.11.1.12): http://www.whatwg.org/specs/web-apps/current-work/#pixel-manipulation
Created attachment 56185 [details] Proposed patch
Comment on attachment 56185 [details] Proposed patch > + > + if (!isfinite(sx) || !isfinite(sy) || !isfinite(sw) || !isfinite(sh)) { > + ec = NOT_SUPPORTED_ERR; > + return 0; > + } > + > + if (!sw || !sh) { > + ec = INDEX_SIZE_ERR; > + return 0; > + } Doesnt it make sense to put this test before the first one? I mean check !sw before !isfinite(sh) ?
Created attachment 56192 [details] Proposed patch v2 I suppose that makes sense. Updated patch, also reordered similar checks in createImageData()
Comment on attachment 56192 [details] Proposed patch v2 Clearing flags on attachment: 56192 Committed r59582: <http://trac.webkit.org/changeset/59582>
All reviewed patches have been landed. Closing bug.
Revision r59582 cherry-picked into qtwebkit-2.0 with commit 05f1904956548b8637eab82cf7f835218af6129a