diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-26 14:34:57 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-26 14:34:57 +0400 |
commit | 7025a1bd7830c3bb58ea7f6a3dba8089869591eb (patch) | |
tree | 26b554cabc9b9f1f18c7b7057ca0284fc966c60d | |
parent | bc1eb0bf0a0c5a6ebf3ff19dae0bfe6a65529b8e (diff) |
Fix T37945: Crash after undo
Issue was caused by some typos in readfile.c made in
original commit of image cache rewrite.
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 97e11d57126..ac69394a309 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1354,7 +1354,13 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) } for (; ima; ima = ima->id.next) { - ima->cache = newmclipadr(fd, ima->cache); + ima->cache = newimaadr(fd, ima->cache); + if (ima->cache == NULL) { + ima->bindcode = 0; + ima->tpageflag &= ~IMA_GLBIND_IS_DATA; + ima->gputexture = NULL; + ima->rr = NULL; + } for (i = 0; i < IMA_MAX_RENDER_SLOT; i++) ima->renders[i] = newimaadr(fd, ima->renders[i]); @@ -3277,7 +3283,7 @@ static void direct_link_image(FileData *fd, Image *ima) ima->cache = NULL; /* if not restored, we keep the binded opengl index */ - if (!fd->imamap) { + if (!ima->cache) { ima->bindcode = 0; ima->tpageflag &= ~IMA_GLBIND_IS_DATA; ima->gputexture = NULL; |