summaryrefslogtreecommitdiffstats
path: root/libmpdemux/aviheader.c
diff options
context:
space:
mode:
authoriive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-04-06 20:04:02 +0000
committeriive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-04-06 20:04:02 +0000
commit64159b23f862d9467319ef450a9f1c9c7267027b (patch)
treed28c3d1adb65df7af9b3087538beb18140deb489 /libmpdemux/aviheader.c
parente34e980420f8c55418105299544cdf125cf3bf29 (diff)
downloadmpv-64159b23f862d9467319ef450a9f1c9c7267027b.tar.bz2
mpv-64159b23f862d9467319ef450a9f1c9c7267027b.tar.xz
Limit the number of entires to the amount that does fit into the chunk.
the function need rewrite as it assumes quite many things that are not guaranteed by the specifications. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18050 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/aviheader.c')
-rw-r--r--libmpdemux/aviheader.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmpdemux/aviheader.c b/libmpdemux/aviheader.c
index 9f95ca339b..e19e3198c1 100644
--- a/libmpdemux/aviheader.c
+++ b/libmpdemux/aviheader.c
@@ -224,6 +224,11 @@ while(1){
memset(s->dwReserved, 0, 3*4);
print_avisuperindex_chunk(s,MSGL_V);
+
+ if( ((chunksize/4)/s->wLongsPerEntry) < s->nEntriesInUse){
+ mp_msg (MSGT_HEADER, MSGL_WARN, "Broken super index chunk\n");
+ s->nEntriesInUse = (chunksize/4)/s->wLongsPerEntry;
+ }
// Check and fix this useless crap
if(s->wLongsPerEntry != sizeof (avisuperindex_entry)/4) {