CE workaround - skipping the movie is better than crashing if the LUT cannot be allocated

svn-id: r16218
This commit is contained in:
Nicolas Bacca 2004-12-20 23:57:21 +00:00
parent 4e497117bd
commit c741d06504

View File

@ -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;