aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorSven Hesse2011-01-19 09:02:07 +0000
committerSven Hesse2011-01-19 09:02:07 +0000
commit2e30eca6d0c61e0c44836dbee6882397f41d1984 (patch)
treed5229431f5dfc4f59c48218a6899367cb7c139fe /graphics
parent12ff4f51f15aeb9c78f381e7d2e9f2f6ca69dcef (diff)
downloadscummvm-rg350-2e30eca6d0c61e0c44836dbee6882397f41d1984.tar.gz
scummvm-rg350-2e30eca6d0c61e0c44836dbee6882397f41d1984.tar.bz2
scummvm-rg350-2e30eca6d0c61e0c44836dbee6882397f41d1984.zip
VIDEO: Don't segfault when no audiostream is present
svn-id: r55322
Diffstat (limited to 'graphics')
-rw-r--r--graphics/video/coktel_decoder.cpp6
1 files changed, 3 insertions, 3 deletions
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