[Bf-blender-cvs] [74e32ef] master: Fix wrong memory write in partial render update with Save Buffers enabled

Sergey Sharybin noreply at git.blender.org
Tue Jun 10 13:13:20 CEST 2014


Commit: 74e32efbc8e292927db9b5e8118a63782ce96010
Author: Sergey Sharybin
Date:   Tue Jun 10 17:10:37 2014 +0600
https://developer.blender.org/rB74e32efbc8e292927db9b5e8118a63782ce96010

Fix wrong memory write in partial render update with Save Buffers enabled

No idea why this issue hasn't been spotted before. Took several hours to
figure out where exactly wrong memory access happens..

P.S. I really want to switch ImBuf->rect from int* to unsigned char*...

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

M	source/blender/imbuf/intern/colormanagement.c

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

diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 21ee8eb..2644b8a 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -2809,7 +2809,7 @@ void IMB_partial_display_buffer_update(ImBuf *ibuf, const float *linear_buffer,
 		int y;
 		for (y = ymin; y < ymax; y++) {
 			int index = y * buffer_width * 4;
-			memcpy(ibuf->rect + index, display_buffer + index, (xmax - xmin) * 4);
+			memcpy((unsigned char *)ibuf->rect + index, display_buffer + index, (xmax - xmin) * 4);
 		}
 	}
 }




More information about the Bf-blender-cvs mailing list