瀏覽代碼

Fix crash when culling compute nodes in state-sorted bin

rdb 10 年之前
父節點
當前提交
9b4ce5ec0a
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      panda/src/cull/cullBinStateSorted.I

+ 6 - 2
panda/src/cull/cullBinStateSorted.I

@@ -33,9 +33,13 @@ CullBinStateSorted(const string &name, GraphicsStateGuardianBase *gsg,
 ////////////////////////////////////////////////////////////////////
 INLINE CullBinStateSorted::ObjectData::
 ObjectData(CullableObject *object) :
-  _object(object),
-  _format(object->_munged_data->get_format())
+  _object(object)
 {
+  if (object->_munged_data == NULL) {
+    _format = NULL;
+  } else {
+    _format = object->_munged_data->get_format();
+  }
 }
 
 ////////////////////////////////////////////////////////////////////