summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-13 09:01:18 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-13 09:01:18 +0000
commit72d780945809ab432e748e2a405e5fe8b2965404 (patch)
tree0984a3f819b6d68e50c76988f59e70ca011b52c5 /libmpdemux
parentd6081d2977c71f61a47077dccd78d0ed54956147 (diff)
downloadmpv-72d780945809ab432e748e2a405e5fe8b2965404.tar.bz2
mpv-72d780945809ab432e748e2a405e5fe8b2965404.tar.xz
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
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/dvbin.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmpdemux/dvbin.c b/libmpdemux/dvbin.c
index 0c8df4d88f..143bf9302c 100644
--- a/libmpdemux/dvbin.c
+++ b/libmpdemux/dvbin.c
@@ -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);