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 id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersvlad, joe
bugs630465
milestone2.0b12pre
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;