1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 15:52:25 +00:00

Be more robust against corrupted RM files that contain invalid packet length

by seeking to a known good place when index table is available.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28665 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
zuxy 2009-02-19 11:42:05 +00:00
parent fdae4e0095
commit 757e575aeb

View File

@ -624,7 +624,15 @@ static int demux_real_fill_buffer(demuxer_t *demuxer, demux_stream_t *dsds)
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;
}