aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorNicolas Bacca2004-12-20 23:57:21 +0000
committerNicolas Bacca2004-12-20 23:57:21 +0000
commitc741d06504c0d02cca88eb11dec5733036d749a9 (patch)
tree4ae2525a959b04724f394cc22aa6cae0fd3d49ec /graphics
parent4e497117bd4c5a3376a6edb45a0c76f1398daa88 (diff)
downloadscummvm-rg350-c741d06504c0d02cca88eb11dec5733036d749a9.tar.gz
scummvm-rg350-c741d06504c0d02cca88eb11dec5733036d749a9.tar.bz2
scummvm-rg350-c741d06504c0d02cca88eb11dec5733036d749a9.zip
CE workaround - skipping the movie is better than crashing if the LUT cannot be allocated
svn-id: r16218
Diffstat (limited to 'graphics')
-rw-r--r--graphics/animation.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/graphics/animation.cpp b/graphics/animation.cpp
index 1e472e0608..5cb3f70f22 100644
--- a/graphics/animation.cpp
+++ b/graphics/animation.cpp
@@ -321,6 +321,10 @@ void BaseAnimationState::buildLookup() {
return;
lookup = (OverlayColor *)calloc((BITDEPTH+1) * (BITDEPTH+1) * 256, sizeof(OverlayColor));
+ if (!lookup) {
+ warning("Not enough memory to allocate LUT - cannot play sequence");
+ return;
+ }
int y, cb, cr;
int r, g, b;
@@ -348,6 +352,9 @@ void BaseAnimationState::buildLookup() {
void BaseAnimationState::plotYUV(OverlayColor *lut, int width, int height, byte *const *dat) {
+ if (!lut)
+ return;
+
OverlayColor *ptr = overlay + (MOVIE_HEIGHT - height) / 2 * MOVIE_WIDTH + (MOVIE_WIDTH - width) / 2;
int x, y;