From a036626604d3c693546ade46e0096fb8e4070531 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 20 Sep 2010 05:46:07 +0000 Subject: bugfix [#23849] When the file is opened, Blender 2.5x crushes. id-property arrays saved in 2.4x would crash on reloading. --- source/blender/blenloader/intern/readfile.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 25af3faa069..fc700c8db8b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1397,6 +1397,14 @@ static void IDP_DirectLinkIDPArray(IDProperty *prop, int switch_endian, FileData prop->data.pointer = newdataadr(fd, prop->data.pointer); array= (IDProperty*) prop->data.pointer; + + /* note!, idp-arrays didn't exist in 2.4x, so the pointer will be cleared + * theres not really anything we can do to correct this, at least dont crash */ + if(array==NULL) { + prop->len= 0; + prop->totallen= 0; + } + for(i=0; ilen; i++) IDP_DirectLinkProperty(&array[i], switch_endian, fd); -- cgit v1.2.3