[Bf-blender-cvs] [87aa456ea51] master: Fix T61172: Crash in texture paint undo/redo

Campbell Barton noreply at git.blender.org
Mon Feb 4 09:51:26 CET 2019


Commit: 87aa456ea516f49c6029cf30f8f0dff16cbb58bc
Author: Campbell Barton
Date:   Mon Feb 4 19:50:46 2019 +1100
Branches: master
https://developer.blender.org/rB87aa456ea516f49c6029cf30f8f0dff16cbb58bc

Fix T61172: Crash in texture paint undo/redo

Mixing texture paint undo w/ memfile undo was crashing.

The gputextures and render result are written to the FileData.imamap
but weren't read back.

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ba4bebf1bd9..2723210781f 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3938,6 +3938,12 @@ static void direct_link_image(FileData *fd, Image *ima)
 		}
 		ima->rr = NULL;
 	}
+	else {
+		for (int i = 0; i < TEXTARGET_COUNT; i++) {
+			ima->gputexture[i] = newimaadr(fd, ima->gputexture[i]);
+		}
+		ima->rr = newimaadr(fd, ima->rr);
+	}
 
 	/* undo system, try to restore render buffers */
 	link_list(fd, &(ima->renderslots));



More information about the Bf-blender-cvs mailing list