From 02b24e655bdb2de67987c0332c78f16d0f557e48 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Aug 2011 14:43:11 +0000 Subject: fix for bug where changing movie filepaths would reset the strip length. also fixed possible & unlikely buffer overflow. --- source/blender/blenkernel/intern/sequencer.c | 1 + source/blender/editors/space_sequencer/sequencer_edit.c | 5 ++++- source/blender/imbuf/intern/anim_movie.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index d6a152a5280..3aebbea789f 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -699,6 +699,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range) seq->len = 0; } seq->strip->len = seq->len; + break; case SEQ_SOUND: #ifdef WITH_AUDASPACE if(!seq->sound) diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 447426aed13..ee5eb12f858 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2870,12 +2870,15 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) else { /* lame, set rna filepath */ PointerRNA seq_ptr; + PropertyRNA *prop; char filepath[FILE_MAX]; RNA_pointer_create(&scene->id, &RNA_Sequence, seq, &seq_ptr); RNA_string_get(op->ptr, "filepath", filepath); - RNA_string_set(&seq_ptr, "filepath", filepath); + prop= RNA_struct_find_property(&seq_ptr, "filepath"); + RNA_property_string_set(&seq_ptr, prop, filepath); + RNA_property_update(C, &seq_ptr, prop); } WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 919b0eb0c29..8b0104fcdca 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -355,7 +355,7 @@ struct anim * IMB_open_anim( const char * name, int ib_flags) { anim = (struct anim*)MEM_callocN(sizeof(struct anim), "anim struct"); if (anim != NULL) { - strcpy(anim->name, name); /* fixme: possible buffer overflow here? */ + BLI_strncpy(anim->name, name, sizeof(anim->name)); anim->ib_flags = ib_flags; } return(anim); -- cgit v1.2.3