Bug 1357090 - Check that a texture's level_base is not too high. r=daoshengmu

MozReview-Commit-ID: 1EKDTrcTacw
This commit is contained in:
Jeff Gilbert 2017-05-22 09:53:23 -04:00
parent 26a0f7ac24
commit eb27aad2c1

View File

@ -314,6 +314,12 @@ WebGLTexture::IsComplete(const char* funcName, uint32_t texUnit,
{
*out_initFailed = false;
const auto maxLevel = kMaxLevelCount - 1;
if (mBaseMipmapLevel > maxLevel) {
*out_reason = "`level_base` too high.";
return false;
}
if (!EnsureLevelInitialized(funcName, mBaseMipmapLevel)) {
*out_initFailed = true;
return false;