mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-17 12:12:10 -04:00
prevent crash when packing too much
This commit is contained in:
parent
4dd46f7ca1
commit
764d561740
@ -705,6 +705,8 @@ pack_object(PyObject *object) {
|
||||
bool is_instance = false;
|
||||
|
||||
const DCClass *dclass = NULL;
|
||||
const DCPackerInterface *current_field = get_current_field();
|
||||
if (current_field != (DCPackerInterface *)NULL) {
|
||||
const DCClassParameter *class_param = get_current_field()->as_class_parameter();
|
||||
if (class_param != (DCClassParameter *)NULL) {
|
||||
dclass = class_param->get_class();
|
||||
@ -715,6 +717,7 @@ pack_object(PyObject *object) {
|
||||
Py_DECREF(class_def);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If dclass is not NULL, the packer is expecting a class object.
|
||||
// There are then two cases: (1) the user has supplied a matching
|
||||
|
Loading…
x
Reference in New Issue
Block a user