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

Nicolas Bacca arisme at users.sourceforge.net
Mon Dec 20 15:26:01 CET 2004


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

Modified Files:
      Tag: branch-0-7-0
	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.15.2.1
diff -u -d -r1.15 -r1.15.2.1
--- animation.cpp	5 Dec 2004 02:55:06 -0000	1.15
+++ animation.cpp	20 Dec 2004 23:25:07 -0000	1.15.2.1
@@ -322,6 +322,11 @@
 
 	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;
 	int pos = 0;
@@ -348,6 +353,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