imageSmoothingEnabled frequent, unpredictable crashes

https://bugs.webkit.org/show_bug.cgi?id=107161

Patch by Alexis Hetu <sugoi@chromium.org> on 2013-01-17
Reviewed by Stephen White.

Source/WebCore:

Added a NULL pointer check to fix a crash.

Test: fast/canvas/canvas-imageSmoothingEnabled-zero-size.html

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setWebkitImageSmoothingEnabled):

LayoutTests:

Added a layout test for setting image smoothing enabled on a 0 sized
canvas.

* fast/canvas/canvas-imageSmoothingEnabled-zero-size-expected.txt: Added.
* fast/canvas/canvas-imageSmoothingEnabled-zero-size.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 90313da3
2013-01-17 Alexis Hetu <sugoi@chromium.org>
imageSmoothingEnabled frequent, unpredictable crashes
https://bugs.webkit.org/show_bug.cgi?id=107161
Reviewed by Stephen White.
Added a layout test for setting image smoothing enabled on a 0 sized
canvas.
* fast/canvas/canvas-imageSmoothingEnabled-zero-size-expected.txt: Added.
* fast/canvas/canvas-imageSmoothingEnabled-zero-size.html: Added.
2013-01-17 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r140049.
<!doctype html>
<html>
<body>
This test passes by not crashing !
<script>
if (window.testRunner) {
testRunner.dumpAsText();
}
window.onload = function () {
var canvas = document.createElement('canvas');
canvas.width = 0;
canvas.height = 0;
var context = canvas.getContext('2d');
if(context.webkitImageSmoothingEnabled) {context.webkitImageSmoothingEnabled = false;}
};
</script>
</body>
</html>
2013-01-17 Alexis Hetu <sugoi@chromium.org>
imageSmoothingEnabled frequent, unpredictable crashes
https://bugs.webkit.org/show_bug.cgi?id=107161
Reviewed by Stephen White.
Added a NULL pointer check to fix a crash.
Test: fast/canvas/canvas-imageSmoothingEnabled-zero-size.html
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setWebkitImageSmoothingEnabled):
2013-01-17 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r140049.
......@@ -2398,7 +2398,9 @@ void CanvasRenderingContext2D::setWebkitImageSmoothingEnabled(bool enabled)
realizeSaves();
modifiableState().m_imageSmoothingEnabled = enabled;
drawingContext()->setImageInterpolationQuality(enabled ? DefaultInterpolationQuality : InterpolationNone);
GraphicsContext* c = drawingContext();
if (c)
c->setImageInterpolationQuality(enabled ? DefaultInterpolationQuality : InterpolationNone);
}
} // namespace WebCore
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment