# HG changeset patch # User nicodvb # Date 1147510878 0 # Node ID aa9ae54516c376d4302ca7ba242826150fd23085 # Parent 0ea3c732d72dc642df60d04c3e641da9886c15b0 unconditionally stop allocating memory for dvb_channel_t after 1 MB: it's unreasonably big diff -r 0ea3c732d72d -r aa9ae54516c3 libmpdemux/dvbin.c --- 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);