[MPlayer-cvslog] r35315 - trunk/libmpdemux/muxer_avi.c

reimar subversion at mplayerhq.hu
Wed Oct 31 21:29:28 CET 2012


Author: reimar
Date: Wed Oct 31 21:29:28 2012
New Revision: 35315

Log:
Do range check before using the variable for array indexing.
The other way round makes little sense...

Modified:
   trunk/libmpdemux/muxer_avi.c

Modified: trunk/libmpdemux/muxer_avi.c
==============================================================================
--- trunk/libmpdemux/muxer_avi.c	Wed Oct 31 21:11:49 2012	(r35314)
+++ trunk/libmpdemux/muxer_avi.c	Wed Oct 31 21:29:28 2012	(r35315)
@@ -228,7 +228,7 @@ static void avifile_write_header(muxer_t
   }
 
   /* deal with stream delays */
-  for (i = 0; muxer->streams[i] && i < MUXER_MAX_STREAMS; ++i) {
+  for (i = 0; i < MUXER_MAX_STREAMS && muxer->streams[i]; ++i) {
       muxer_stream_t *s = muxer->streams[i];
       if (s->type == MUXER_TYPE_AUDIO && muxer->audio_delay_fix > 0.0) {
           s->h.dwStart = muxer->audio_delay_fix * s->h.dwRate/s->h.dwScale + 0.5;


More information about the MPlayer-cvslog mailing list