Bug 1170893 - Return null for invalid internal format. r=kamidphish

This commit is contained in:
Edwin Flores 2015-07-07 16:24:25 +10:00
Родитель cd06229252
Коммит aac1f28011
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -1211,6 +1211,13 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx,
if (IsExtensionEnabled(WebGLExtensionID::EXT_sRGB)) { if (IsExtensionEnabled(WebGLExtensionID::EXT_sRGB)) {
const TexInternalFormat effectiveInternalFormat = const TexInternalFormat effectiveInternalFormat =
fba.Texture()->ImageInfoBase().EffectiveInternalFormat(); fba.Texture()->ImageInfoBase().EffectiveInternalFormat();
if (effectiveInternalFormat == LOCAL_GL_NONE) {
ErrorInvalidOperation("getFramebufferAttachmentParameter: "
"texture contains no data");
return JS::NullValue();
}
TexInternalFormat unsizedinternalformat = LOCAL_GL_NONE; TexInternalFormat unsizedinternalformat = LOCAL_GL_NONE;
TexType type = LOCAL_GL_NONE; TexType type = LOCAL_GL_NONE;
UnsizedInternalFormatAndTypeFromEffectiveInternalFormat( UnsizedInternalFormatAndTypeFromEffectiveInternalFormat(