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
parent b37a7e8f43
commit bc882725e3

View File

@ -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(