[MPlayer-cvslog] r24475 - trunk/libmpdemux/demux_ty.c

reimar subversion at mplayerhq.hu
Fri Sep 14 18:58:32 CEST 2007


Author: reimar
Date: Fri Sep 14 18:58:31 2007
New Revision: 24475

Log:
Move boundary check before use!


Modified:
   trunk/libmpdemux/demux_ty.c

Modified: trunk/libmpdemux/demux_ty.c
==============================================================================
--- trunk/libmpdemux/demux_ty.c	(original)
+++ trunk/libmpdemux/demux_ty.c	Fri Sep 14 18:58:31 2007
@@ -197,6 +197,10 @@ static int ty_tmf_filetoparts( demuxer_t
 
       if ( isty )
       {
+         if ( parts >= MAX_TMF_PARTS ) {
+            mp_msg( MSGT_DEMUX, MSGL_ERR, "ty:tmf too big\n" );
+            break;
+         }
          tivo->tmfparts[ parts ].fileNo = parts;
          tivo->tmfparts[ parts ].fileSize = size;
          tivo->tmfparts[ parts ].startOffset = offset + 512;
@@ -222,8 +226,6 @@ static int ty_tmf_filetoparts( demuxer_t
            tivo->tmfparts[ parts ].startOffset
          );
          parts++;
-         if ( parts > MAX_TMF_PARTS )
-            mp_msg( MSGT_DEMUX, MSGL_ERR, "ty:tmf too big\n" );
       }
 
       if ( ( offset + skip ) > totalsize )



More information about the MPlayer-cvslog mailing list