changeset 18049:77a3b0d11ca5

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.
author iive
date Thu, 06 Apr 2006 20:04:02 +0000
parents eff6cb3278aa
children d437b070b8a7
files libmpdemux/aviheader.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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) {