Bug 958723 - Check for valid FB first. - r=gabadie

This commit is contained in:
Jeff Gilbert 2014-03-05 14:16:02 -08:00
Родитель b22fb48408
Коммит 50b8293e47
1 изменённых файлов: 5 добавлений и 5 удалений

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

@ -1343,6 +1343,11 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx,
return JS::NullValue();
}
if (!mBoundFramebuffer) {
ErrorInvalidOperation("getFramebufferAttachmentParameter: cannot query framebuffer 0");
return JS::NullValue();
}
if (attachment != LOCAL_GL_DEPTH_ATTACHMENT &&
attachment != LOCAL_GL_STENCIL_ATTACHMENT &&
attachment != LOCAL_GL_DEPTH_STENCIL_ATTACHMENT)
@ -1365,11 +1370,6 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx,
}
}
if (!mBoundFramebuffer) {
ErrorInvalidOperation("getFramebufferAttachmentParameter: cannot query framebuffer 0");
return JS::NullValue();
}
MakeContextCurrent();
const WebGLFramebuffer::Attachment& fba = mBoundFramebuffer->GetAttachment(attachment);