aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-14 23:05:59 -0500
committerPaul Gilbert2017-02-14 23:05:59 -0500
commitf0e08796b07d4a4c362e12f440125170288a5927 (patch)
tree6ebd931aab73e081ddc0384a4e9104e0435c5781 /engines/titanic/support
parentaa77e260b2aab6d48f7e11bdef422aa59d778a4b (diff)
downloadscummvm-rg350-f0e08796b07d4a4c362e12f440125170288a5927.tar.gz
scummvm-rg350-f0e08796b07d4a4c362e12f440125170288a5927.tar.bz2
scummvm-rg350-f0e08796b07d4a4c362e12f440125170288a5927.zip
TITANIC: Work around cylinder holder 8-bit frame with no palette
The video for the cylinder holder has a single 8-bit frame at the start of the sequence for opening when there's no cylinder inside. This fix works around it by ignoring 8-bits frame when there's no palette available.
Diffstat (limited to 'engines/titanic/support')
-rw-r--r--engines/titanic/support/avi_surface.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 42e3618b97..a1dbecbe1c 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -284,10 +284,13 @@ void AVISurface::copyMovieFrame(const Graphics::Surface &src, Graphics::ManagedS
if (src.format.bytesPerPixel == 1) {
// Paletted 8-bit, so convert to 16-bit and copy over
- Graphics::Surface *s = src.convertTo(dest.format, _decoder->getPalette());
- dest.blitFrom(*s, copyRect, Common::Point(0, 0));
- s->free();
- delete s;
+ const byte *palette = _decoder->getPalette();
+ if (palette) {
+ Graphics::Surface *s = src.convertTo(dest.format, palette);
+ dest.blitFrom(*s, copyRect, Common::Point(0, 0));
+ s->free();
+ delete s;
+ }
} else if (src.format.bytesPerPixel == 2) {
// Source is already 16-bit, with no alpha, so do a straight copy
dest.blitFrom(src, copyRect, Common::Point(0, 0));