[MPlayer-cvslog] r28665 - trunk/libmpdemux/demux_real.c

zuxy subversion at mplayerhq.hu
Thu Feb 19 12:42:06 CET 2009


Author: zuxy
Date: Thu Feb 19 12:42:05 2009
New Revision: 28665

Log:
Be more robust against corrupted RM files that contain invalid packet length
by seeking to a known good place when index table is available.

Modified:
   trunk/libmpdemux/demux_real.c

Modified: trunk/libmpdemux/demux_real.c
==============================================================================
--- trunk/libmpdemux/demux_real.c	Thu Feb 19 11:07:46 2009	(r28664)
+++ trunk/libmpdemux/demux_real.c	Thu Feb 19 12:42:05 2009	(r28665)
@@ -624,7 +624,15 @@ static int demux_real_fill_buffer(demuxe
     if (len < 12){
 	mp_msg(MSGT_DEMUX, MSGL_V,"%08X: packet v%d len=%d  \n",(int)demuxer->filepos,(int)version,(int)len);
 	mp_msg(MSGT_DEMUX, MSGL_WARN,"bad packet len (%d)\n", len);
-	stream_skip(demuxer->stream, len);
+	if ((unsigned)demuxer->video->id < MAX_STREAMS) {
+	    if (priv->current_vpacket + 1 < priv->index_table_size[demuxer->video->id]) {
+		stream_seek(demuxer->stream, priv->index_table[demuxer->video->id][++priv->current_vpacket].offset);
+	    }
+	} else if ((unsigned)demuxer->audio->id < MAX_STREAMS) {
+	    if (priv->current_apacket + 1 < priv->index_table_size[demuxer->audio->id]) {
+		stream_seek(demuxer->stream, priv->index_table[demuxer->audio->id][++priv->current_apacket].offset);
+	    }
+	}
 	continue; //goto loop;
     }
 



More information about the MPlayer-cvslog mailing list