Changeset 6fd31613a0c5e8858cee9f58bf4bb533e120b012

Show
Ignore:
Timestamp:
11/26/02 18:28:22 (6 years ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1038331702 +0000
git-parent:

[aa142dbe5158b5790783bd2464693962d44bf5e6]

git-author:
Laurent Aimar <fenrir@videolan.org> 1038331702 +0000
Message:
  • mp4: prevent float exeption with some truncated file.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/mp4/mp4.c

    rfa94ffd r6fd3161  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: mp4.c,v 1.6 2002/11/19 17:23:21 fenrir Exp $ 
     5 * $Id: mp4.c,v 1.7 2002/11/26 17:28:22 fenrir Exp $ 
    66 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
    77 *  
     
    277277    p_input->stream.p_selected_program = p_input->stream.pp_programs[0]; 
    278278    /* XXX beurk and beurk, see MP4Demux and MP4Seek */ 
    279     p_input->stream.i_mux_rate =   
    280         p_input->stream.p_selected_area->i_size / 50 /  
    281         ( p_demux->i_duration / p_demux->i_timescale ); 
     279    if( p_demux->i_duration/p_demux->i_timescale > 0 ) 
     280    { 
     281        p_input->stream.i_mux_rate =   
     282            p_input->stream.p_selected_area->i_size / 50 /  
     283            ( p_demux->i_duration / p_demux->i_timescale ); 
     284    } 
     285    else 
     286    { 
     287        p_input->stream.i_mux_rate = 0; 
     288    } 
    282289    vlc_mutex_unlock( &p_input->stream.stream_lock ); 
    283290