diff options
Diffstat (limited to 'graphics')
-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); |