Bug 969870 - Use fallible allocations to store the used attributes of a WebGL program; r=bjacob
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Sun, 09 Feb 2014 18:16:38 -0500
changeset 167786 2f3a07546a335ab62a922348907262464903c05f
parent 167785 1bab733c5a83508638332db9b86473649eb92fa9
child 167787 1827e672f1792e9c142841bd08ff8ed13bc1efdf
push id39547
push usereakhgari@mozilla.com
push dateSun, 09 Feb 2014 23:16:41 +0000
treeherdermozilla-inbound@2f3a07546a33 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs969870
milestone30.0a1
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 969870 - Use fallible allocations to store the used attributes of a WebGL program; r=bjacob It seems like the sizes for these data structures can be controlled from Web content, and we are already prepared to deal with OOM conditions, except that we are using infallible allocations by mistake.
content/canvas/src/WebGLProgram.h
--- a/content/canvas/src/WebGLProgram.h
+++ b/content/canvas/src/WebGLProgram.h
@@ -117,17 +117,17 @@ protected:
 
     GLuint mGLName;
     bool mLinkStatus;
     // attached shaders of the program object
     nsTArray<WebGLRefPtr<WebGLShader> > mAttachedShaders;
     CheckedUint32 mGeneration;
 
     // post-link data
-    nsTArray<bool> mAttribsInUse;
+    FallibleTArray<bool> mAttribsInUse;
     nsAutoPtr<CStringMap> mIdentifierMap, mIdentifierReverseMap;
     nsAutoPtr<CStringToUniformInfoMap> mUniformInfoMap;
     int mAttribMaxNameLength;
 };
 
 } // namespace mozilla
 
 #endif