From 2e30eca6d0c61e0c44836dbee6882397f41d1984 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Wed, 19 Jan 2011 09:02:07 +0000 Subject: VIDEO: Don't segfault when no audiostream is present svn-id: r55322 --- graphics/video/coktel_decoder.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics') diff --git a/graphics/video/coktel_decoder.cpp b/graphics/video/coktel_decoder.cpp index 3ee4bdcdda..f5813db8df 100644 --- a/graphics/video/coktel_decoder.cpp +++ b/graphics/video/coktel_decoder.cpp @@ -1400,7 +1400,7 @@ bool IMDDecoder::renderFrame(Common::Rect &rect) { } void IMDDecoder::nextSoundSlice(bool hasNextCmd) { - if (hasNextCmd || !_soundEnabled) { + if (hasNextCmd || !_soundEnabled || !_audioStream) { // Skip sound _stream->skip(_soundSliceSize); @@ -1420,7 +1420,7 @@ void IMDDecoder::nextSoundSlice(bool hasNextCmd) { bool IMDDecoder::initialSoundSlice(bool hasNextCmd) { int dataLength = _soundSliceSize * _soundSlicesCount; - if (hasNextCmd || !_soundEnabled) { + if (hasNextCmd || !_soundEnabled || !_audioStream) { // Skip sound _stream->skip(dataLength); @@ -1440,7 +1440,7 @@ bool IMDDecoder::initialSoundSlice(bool hasNextCmd) { } void IMDDecoder::emptySoundSlice(bool hasNextCmd) { - if (hasNextCmd || !_soundEnabled) + if (hasNextCmd || !_soundEnabled || !_audioStream) return; // Create an empty sound buffer and queue it -- cgit v1.2.3