[Scummvm-cvs-logs] CVS: scummvm/graphics animation.cpp,1.15,1.16

Nicolas Bacca arisme at users.sourceforge.net
Mon Dec 20 15:58:02 CET 2004


Update of /cvsroot/scummvm/scummvm/graphics
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32262

Modified Files:
	animation.cpp 
Log Message:
CE workaround - skipping the movie is better than crashing if the LUT cannot be allocated

Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/graphics/animation.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- animation.cpp	5 Dec 2004 02:55:06 -0000	1.15
+++ animation.cpp	20 Dec 2004 23:57:21 -0000	1.16
@@ -321,6 +321,10 @@
 		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::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;





More information about the Scummvm-git-logs mailing list