[MPlayer-cvslog] r35347 - trunk/sub/spudec.c

reimar subversion at mplayerhq.hu
Mon Nov 5 21:45:40 CET 2012


Author: reimar
Date: Mon Nov  5 21:45:40 2012
New Revision: 35347

Log:
Try to do something sensible when malloc fails instead
of continuing which is sure to crash.

Modified:
   trunk/sub/spudec.c

Modified: trunk/sub/spudec.c
==============================================================================
--- trunk/sub/spudec.c	Mon Nov  5 21:42:00 2012	(r35346)
+++ trunk/sub/spudec.c	Mon Nov  5 21:45:40 2012	(r35347)
@@ -956,6 +956,11 @@ void spudec_draw_scaled(void *me, unsign
 	  table_y = calloc(spu->scaled_height, sizeof(scale_pixel));
 	  if (!table_x || !table_y) {
 	    mp_msg(MSGT_SPUDEC, MSGL_FATAL, "Fatal: spudec_draw_scaled: calloc failed\n");
+	    free(table_x);
+	    table_x = NULL;
+	    free(table_y);
+	    table_y = NULL;
+	    break;
 	  }
 	  scale_table(0, 0, spu->width - 1, spu->scaled_width - 1, table_x);
 	  scale_table(0, 0, spu->height - 1, spu->scaled_height - 1, table_y);


More information about the MPlayer-cvslog mailing list