From c741d06504c0d02cca88eb11dec5733036d749a9 Mon Sep 17 00:00:00 2001 From: Nicolas Bacca Date: Mon, 20 Dec 2004 23:57:21 +0000 Subject: CE workaround - skipping the movie is better than crashing if the LUT cannot be allocated svn-id: r16218 --- graphics/animation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'graphics/animation.cpp') 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; -- cgit v1.2.3