diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-24 14:25:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-24 14:25:12 +0400 |
commit | e06e338e205934af91ead0869dbc9ffa29787988 (patch) | |
tree | bd76a5e70612f73c412a8116902db38cbc7bd932 /source/blender/blenloader | |
parent | b84cdafbb5e927407aec138dd96adb8fe556cbb3 (diff) |
fix [#31079] Revision 45893 crashes when I try to open a certain file created in it.
nasty bug going from 2.63 --> 2.62 --> 2.63, could have incorrect/corrupt data.
fix checks for this case and clears the customdata layer.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b3d586fd78d..d2f6100517a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3810,6 +3810,14 @@ static void direct_link_customdata(FileData *fd, CustomData *data, int count) int i = 0; data->layers= newdataadr(fd, data->layers); + + /* annoying workaround for bug [#31079] loading legacy files with + * no polygons _but_ have stale customdata */ + if (UNLIKELY(count == 0 && data->layers == NULL && data->totlayer != 0)) { + memset(data, 0, sizeof(*data)); + return; + } + data->external= newdataadr(fd, data->external); while (i < data->totlayer) { |