[Bf-blender-cvs] [d7cfee0b683] blender-v2.92-release: Fix use of uninitialized variable in image sequence detection

Campbell Barton noreply at git.blender.org
Thu Jan 21 05:00:46 CET 2021


Commit: d7cfee0b683611a95ec69d47ca6d0f403a89e835
Author: Campbell Barton
Date:   Thu Jan 21 14:54:45 2021 +1100
Branches: blender-v2.92-release
https://developer.blender.org/rBd7cfee0b683611a95ec69d47ca6d0f403a89e835

Fix use of uninitialized variable in image sequence detection

Uninitialized stack memory was being re-used in a loop.

Error in original commit from 04f81c8225f28ba9722cc06dc7f2d8a4d72a3fa3

This happened to work as the same memory location was re-used
between iterations and not overwritten.

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

M	source/blender/editors/space_image/image_sequence.c

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

diff --git a/source/blender/editors/space_image/image_sequence.c b/source/blender/editors/space_image/image_sequence.c
index 0817bdda88d..81f2ced7dee 100644
--- a/source/blender/editors/space_image/image_sequence.c
+++ b/source/blender/editors/space_image/image_sequence.c
@@ -65,10 +65,11 @@ static void image_sequence_get_frame_ranges(wmOperator *op, ListBase *ranges)
   const bool do_frame_range = RNA_boolean_get(op->ptr, "use_sequence_detection");
   ImageFrameRange *range = NULL;
   int range_first_frame = 0;
+  /* Track when a new series of files are found that aren't compatible with the previous file. */
+  char base_head[FILE_MAX], base_tail[FILE_MAX];
 
   RNA_string_get(op->ptr, "directory", dir);
   RNA_BEGIN (op->ptr, itemptr, "files") {
-    char base_head[FILE_MAX], base_tail[FILE_MAX];
     char head[FILE_MAX], tail[FILE_MAX];
     ushort digits;
     char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0);



More information about the Bf-blender-cvs mailing list