changeset 18471:aa9ae54516c3

unconditionally stop allocating memory for dvb_channel_t after 1 MB: it's unreasonably big
author nicodvb
date Sat, 13 May 2006 09:01:18 +0000
parents 0ea3c732d72d
children 57cac8462fa8
files libmpdemux/dvbin.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/dvbin.c	Sat May 13 08:46:31 2006 +0000
+++ b/libmpdemux/dvbin.c	Sat May 13 09:01:18 2006 +0000
@@ -387,6 +387,11 @@
 		list->channels = tmp;
 		memcpy(&(list->channels[list->NUM_CHANNELS]), ptr, sizeof(dvb_channel_t));
 		list->NUM_CHANNELS++;
+		if(sizeof(dvb_channel_t) * list->NUM_CHANNELS >= 1024*1024)
+		{
+			mp_msg(MSGT_DEMUX, MSGL_V, "dvbin.c, > 1MB allocated for channels struct, dropping the rest of the file\r\n");
+			break;
+		}
 	}
 
 	fclose(f);