[Bf-blender-cvs] [cebaedd] master: Fix crash w/ PlayAnim & long filenames
Campbell Barton
noreply at git.blender.org
Thu Oct 15 19:40:10 CEST 2015
Commit: cebaedd7094b547bc426c9a8acc83c950119441d
Author: Campbell Barton
Date: Fri Oct 16 04:31:17 2015 +1100
Branches: master
https://developer.blender.org/rBcebaedd7094b547bc426c9a8acc83c950119441d
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 31690f8..2150d94 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