From 4cd22aea90ccdb2d3b805a8edfa952e10fae8506 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 28 Nov 2011 14:30:28 -0500 Subject: [PATCH] Bug 705663 - Fix braindead WebGLTexture::HasImageInfoAt - r=jrmuizel --- content/canvas/src/WebGLContext.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/canvas/src/WebGLContext.h b/content/canvas/src/WebGLContext.h index 75439ce8d61..2372785a142 100644 --- a/content/canvas/src/WebGLContext.h +++ b/content/canvas/src/WebGLContext.h @@ -1087,9 +1087,10 @@ public: } bool HasImageInfoAt(size_t level, size_t face) const { - return level <= mMaxLevelWithCustomImages && - face < mFacesCount && - ImageInfoAt(level, 0).mIsDefined; + CheckedUint32 checked_index = CheckedUint32(level) * mFacesCount + face; + return checked_index.valid() && + checked_index.value() < mImageInfos.Length() && + ImageInfoAt(level, face).mIsDefined; } static size_t FaceForTarget(WebGLenum target) {