changeset 17990:5f9f5c286716

100L to who wrote this. Also fix broken headers while at it.
author albeu
date Wed, 29 Mar 2006 19:31:31 +0000
parents a9e0c9e0cb70
children 4d96d2130172
files libmpdemux/aviheader.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/aviheader.c	Wed Mar 29 11:33:13 2006 +0000
+++ b/libmpdemux/aviheader.c	Wed Mar 29 19:31:31 2006 +0000
@@ -225,7 +225,12 @@
 	  
       print_avisuperindex_chunk(s,MSGL_V);
 
-      msize = sizeof (uint32_t) * s->wLongsPerEntry * s->nEntriesInUse;
+      // Check and fix this useless crap
+      if(s->wLongsPerEntry != sizeof (avisuperindex_entry)/4) {
+          mp_msg (MSGT_HEADER, MSGL_WARN, "Broken super index chunk size: %u\n",s->wLongsPerEntry);
+          s->wLongsPerEntry = sizeof(avisuperindex_entry)/4;
+      }
+      msize = sizeof (avisuperindex_entry) * s->nEntriesInUse;
       s->aIndex = malloc(msize);
       memset (s->aIndex, 0, msize);
       s->stdidx = malloc (s->nEntriesInUse * sizeof (avistdindex_chunk));