[Bf-blender-cvs] [ab6c7c5] blender-v2.76a-release: Fix crash w/ PlayAnim & long filenames

Campbell Barton noreply at git.blender.org
Thu Oct 29 11:39:36 CET 2015


Commit: ab6c7c5888b011b99bb113d224efd383cccd412d
Author: Campbell Barton
Date:   Fri Oct 16 04:31:17 2015 +1100
Branches: blender-v2.76a-release
https://developer.blender.org/rBab6c7c5888b011b99bb113d224efd383cccd412d

Fix crash w/ PlayAnim & long filenames

Paths >128 chars could crash.
Replace BLI_newname with direct BLI_stringenc/dec use which makes more sense in this case.

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

M	source/blender/windowmanager/intern/wm_playanim.c

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

diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c
index 37cbe7b..64f77e7 100644
--- a/source/blender/windowmanager/intern/wm_playanim.c
+++ b/source/blender/windowmanager/intern/wm_playanim.c
@@ -412,7 +412,14 @@ static void build_pict_list_ex(PlayState *ps, const char *first, int totframes,
 	else {
 		int count = 0;
 
+		int fp_framenr;
+		struct {
+			char head[FILE_MAX], tail[FILE_MAX];
+			unsigned short digits;
+		} fp_decoded;
+
 		BLI_strncpy(filepath, first, sizeof(filepath));
+		fp_framenr = BLI_stringdec(filepath, fp_decoded.head, fp_decoded.tail, &fp_decoded.digits);
 
 		pupdate_time();
 		ptottime = 1.0;
@@ -503,7 +510,9 @@ static void build_pict_list_ex(PlayState *ps, const char *first, int totframes,
 				ptottime = 0.0;
 			}
 
-			BLI_newname(filepath, +fstep);
+			/* create a new filepath each time */
+			fp_framenr += fstep;
+			BLI_stringenc(filepath, fp_decoded.head, fp_decoded.tail, fp_decoded.digits, fp_framenr);
 
 			while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, 0))) {
 				if (hasevent) {




More information about the Bf-blender-cvs mailing list