Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-08-08 00:42:32 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-08-08 00:42:32 +0300
commit8af8bab0c5acc1cf59c507f28cf5c349782932e6 (patch)
treeaa7b75e7e41c15442843a15a1e11dcaf399f6f5b /source/blender/editors/space_sequencer/sequencer_draw.c
parente96e0ddbee89e4ccce3e0673883625aa73cc949a (diff)
Fix T45726: Wrong handling of 'failed to generate' audio waveform data in VSE strip draw code.
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_draw.c')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 7aa6550a77b..afa59876647 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -224,7 +224,13 @@ static void drawseqwave(const bContext *C, SpaceSeq *sseq, Scene *scene, Sequenc
BLI_spin_unlock(sound->spinlock);
waveform = seq->sound->waveform;
-
+
+ if (waveform->length == 0) {
+ /* BKE_sound_read_waveform() set an empty SoundWaveform data in case it cannot generate a valid one...
+ * See T45726. */
+ return;
+ }
+
startsample = floor((seq->startofs + seq->anim_startofs) / FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
endsample = ceil((seq->startofs + seq->anim_startofs + seq->enddisp - seq->startdisp) / FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
samplestep = (endsample - startsample) * stepsize / (x2 - x1);