quick fix still allowed for possible crash, check for valid newlibadr return value in the while loop.

This commit is contained in:
Campbell Barton 2009-05-25 01:00:17 +00:00
parent b7653ba542
commit 1266e0f2bf

@ -8116,10 +8116,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* check if top parent has compound shape set and if yes, set this object
to compound shaper as well (was the behaviour before, now it's optional) */
Object *parent= newlibadr(fd, lib, ob->parent);
while (parent && parent->parent != NULL) {
parent = newlibadr(fd, lib, parent->parent);
}
if(parent) {
while (parent->parent != NULL) {
parent = newlibadr(fd, lib, parent->parent);
}
if (parent->gameflag & OB_CHILD)
ob->gameflag |= OB_CHILD;
}