diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-01-04 11:41:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-01-04 12:42:44 +0300 |
commit | 598180f98dfbf47bf84def4b79c5693c8e227769 (patch) | |
tree | 0688868baadaa83e535a6b4f14c497e05c77e927 | |
parent | 236fabcc41eb769112a1d61ded82f6b913d0d434 (diff) |
Fix crash sequencer drawing with no sound
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 393e7292d64..8e789c0f21b 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -197,7 +197,7 @@ static void drawseqwave(const bContext *C, SpaceSeq *sseq, Scene *scene, Sequenc * x2 the end x value, same for y1 and y2 * stepsize is width of a pixel. */ - if ((sseq->flag & SEQ_ALL_WAVEFORMS) || (seq->flag & SEQ_AUDIO_DRAW_WAVEFORM)) { + if (seq->sound && ((sseq->flag & SEQ_ALL_WAVEFORMS) || (seq->flag & SEQ_AUDIO_DRAW_WAVEFORM))) { int i, j, pos; int length = floor((x2 - x1) / stepsize) + 1; float ymid = (y1 + y2) / 2; @@ -215,10 +215,10 @@ static void drawseqwave(const bContext *C, SpaceSeq *sseq, Scene *scene, Sequenc } BLI_spin_lock(sound->spinlock); - if (!seq->sound->waveform) { + if (!sound->waveform) { if (!(sound->flags & SOUND_FLAGS_WAVEFORM_LOADING)) { /* prevent sounds from reloading */ - seq->sound->flags |= SOUND_FLAGS_WAVEFORM_LOADING; + sound->flags |= SOUND_FLAGS_WAVEFORM_LOADING; BLI_spin_unlock(sound->spinlock); sequencer_preview_add_sound(C, seq); } @@ -229,7 +229,7 @@ static void drawseqwave(const bContext *C, SpaceSeq *sseq, Scene *scene, Sequenc } BLI_spin_unlock(sound->spinlock); - waveform = seq->sound->waveform; + waveform = sound->waveform; if (waveform->length == 0) { /* BKE_sound_read_waveform() set an empty SoundWaveform data in case it cannot generate a valid one... |