diff options
author | Sven Hesse | 2011-01-23 03:46:38 +0000 |
---|---|---|
committer | Sven Hesse | 2011-01-23 03:46:38 +0000 |
commit | c039b06c3c35c725e19fa5f8027747e402749d46 (patch) | |
tree | d36d9d5974f6a0ea235366fe1adc8aee3c150b48 | |
parent | 57521f7574791b634402a68ee21c1632a309b264 (diff) | |
download | scummvm-rg350-c039b06c3c35c725e19fa5f8027747e402749d46.tar.gz scummvm-rg350-c039b06c3c35c725e19fa5f8027747e402749d46.tar.bz2 scummvm-rg350-c039b06c3c35c725e19fa5f8027747e402749d46.zip |
VIDEO: Fix createSurface() for the case that there's no video
Fixes clicking on the Piano in the Apartment in Urban Runner.
svn-id: r55456
-rw-r--r-- | graphics/video/coktel_decoder.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/graphics/video/coktel_decoder.cpp b/graphics/video/coktel_decoder.cpp index 9ed91b1b3f..fdb244ddf2 100644 --- a/graphics/video/coktel_decoder.cpp +++ b/graphics/video/coktel_decoder.cpp @@ -83,6 +83,9 @@ bool CoktelDecoder::evaluateSeekFrame(int32 &frame, int whence) const { void CoktelDecoder::setSurfaceMemory(void *mem, uint16 width, uint16 height, uint8 bpp) { freeSurface(); + if (!hasVideo()) + return; + // Sanity checks assert((width > 0) && (height > 0)); assert(bpp == getPixelFormat().bytesPerPixel); @@ -119,6 +122,9 @@ void CoktelDecoder::createSurface() { if (hasSurface()) return; + if (!hasVideo()) + return; + if ((_width > 0) && (_height > 0)) _surface.create(_width, _height, getPixelFormat().bytesPerPixel); |