aboutsummaryrefslogtreecommitdiff
path: root/graphics/animation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/animation.cpp')
-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;