浏览代码

Fix crash when no texture is assigned

rdb 17 年之前
父节点
当前提交
c0b420a74a
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      panda/src/glstuff/glGraphicsBuffer_src.cxx

+ 4 - 1
panda/src/glstuff/glGraphicsBuffer_src.cxx

@@ -189,7 +189,10 @@ rebuild_bitplanes() {
   // Bind the FBO
   // Bind the FBO
 
 
   Texture *tex = get_texture(0);
   Texture *tex = get_texture(0);
-
+  if (tex == 0) {
+    return;
+  }
+  
   if (tex->get_texture_type() != Texture::TT_cube_map) {
   if (tex->get_texture_type() != Texture::TT_cube_map) {
     if (_fbo == 0) {
     if (_fbo == 0) {
       glgsg->_glGenFramebuffers(1, &_fbo);
       glgsg->_glGenFramebuffers(1, &_fbo);