aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglframebuffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/webglframebuffer.rs')
-rw-r--r--components/script/dom/webglframebuffer.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs
index 0ab85f14e2f..df9e194962e 100644
--- a/components/script/dom/webglframebuffer.rs
+++ b/components/script/dom/webglframebuffer.rs
@@ -264,12 +264,16 @@ impl WebGLFramebuffer {
Some(WebGLFramebufferAttachment::Texture {
texture: ref att_tex,
level,
- }) => {
- let info = att_tex.image_info_at_face(0, level as u32);
- (
- info.internal_format().map(|t| t.as_gl_constant()),
+ }) => match att_tex.image_info_at_face(0, level as u32) {
+ Some(info) => (
+ Some(info.internal_format().as_gl_constant()),
Some((info.width() as i32, info.height() as i32)),
- )
+ ),
+ None => {
+ self.status
+ .set(constants::FRAMEBUFFER_INCOMPLETE_ATTACHMENT);
+ return;
+ },
},
None => (None, None),
};