fix for crash if image names are too long in adding image strips to the sequencer.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 8 Jul 2010 17:00:06 +0000 (17:00 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 8 Jul 2010 17:00:06 +0000 (17:00 +0000)
source/blender/editors/space_sequencer/sequencer_add.c

index 36ae475e64b990c9f121127f2c0d9f89a4840992..01a99ed2b1f1ceb7c5105070b886f4d08516c7e7 100644 (file)
@@ -459,7 +459,9 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
        se= strip->stripdata;
 
        RNA_BEGIN(op->ptr, itemptr, "files") {
-               RNA_string_get(&itemptr, "name", se->name);
+               char *filename= RNA_string_get_alloc(&itemptr, "name", NULL, 0);
+               BLI_strncpy(se->name, filename, sizeof(se->name));
+               MEM_freeN(filename);
                se++;
        }
        RNA_END;