# HG changeset patch # User iive # Date 1144353842 0 # Node ID 77a3b0d11ca58ea1c0699da17e451fa97c9462f1 # Parent eff6cb3278aaf93c21656e9a7a5b4ca3770bed6e 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. diff -r eff6cb3278aa -r 77a3b0d11ca5 libmpdemux/aviheader.c --- a/libmpdemux/aviheader.c Thu Apr 06 20:03:42 2006 +0000 +++ b/libmpdemux/aviheader.c Thu Apr 06 20:04:02 2006 +0000 @@ -224,6 +224,11 @@ 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) {