Bug 630465. Don't pretend everything is ok when allocating image surfaces failes. r=vlad, a=joe
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 08 Feb 2011 16:30:54 -0500
changeset 62169 ee0596d83d99e22925f7a85ff792eb702bd05e34
parent 62168 ef4d491f9ba0fbece23448cfce69710e1d639680
child 62170 0399ff8f614c598d722836b49ffcb56dfa6f6c59
push id18627
push userbzbarsky@mozilla.com
push dateTue, 08 Feb 2011 21:31:36 +0000
treeherdermozilla-central@b715a81bb7aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad, joe
bugs630465
milestone2.0b12pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 630465. Don't pretend everything is ok when allocating image surfaces failes. r=vlad, a=joe
content/canvas/src/nsCanvasRenderingContext2D.cpp
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -1159,17 +1159,17 @@ nsCanvasRenderingContext2D::InitializeWi
     mThebes->SetLineJoin(gfxContext::LINE_JOIN_MITER);
 
     mThebes->NewPath();
 
     // always force a redraw, because if the surface dimensions were reset
     // then the surface became cleared, and we need to redraw everything.
     Redraw();
 
-    return NS_OK;
+    return mValid ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 NS_IMETHODIMP
 nsCanvasRenderingContext2D::SetIsOpaque(PRBool isOpaque)
 {
     if (isOpaque == mOpaque)
         return NS_OK;