changeset 35221:93337793866d

Do range check before using the variable for array indexing. The other way round makes little sense...
author reimar
date Wed, 31 Oct 2012 20:29:28 +0000
parents 349f03d4c033
children 27640f4f0479
files libmpdemux/muxer_avi.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_avi.c	Wed Oct 31 20:11:49 2012 +0000
+++ b/libmpdemux/muxer_avi.c	Wed Oct 31 20:29:28 2012 +0000
@@ -228,7 +228,7 @@
   }
 
   /* 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;