unconditionally stop allocating memory for dvb_channel_t after 1 MB: it's unreasonably big

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18472 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2006-05-13 09:01:18 +00:00
parent d6081d2977
commit 72d7809458
1 changed files with 5 additions and 0 deletions

View File

@ -387,6 +387,11 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
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);