Changeset a11cc33695f3b4bc9f939e457bd3e5f16397968f

Show
Ignore:
Timestamp:
29/06/08 00:09:27 (3 months ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1214690967 +0000
git-parent:

[26d305ed5a301cd35f7a9bf279742f775fde2658]

git-author:
Laurent Aimar <fenrir@videolan.org> 1214690967 +0000
Message:

Fixed segfault on corrupted wav file.

Files:

Legend:

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

    rd97af9a ra11cc33  
    172172    p_sys->fmt.i_bitrate = GetDWLE( &p_wf->nAvgBytesPerSec ) * 8; 
    173173    p_sys->fmt.audio.i_bitspersample = GetWLE( &p_wf->wBitsPerSample ); 
    174     p_sys->fmt.i_extra = GetWLE( &p_wf->cbSize ); 
     174    if( i_size >= sizeof(WAVEFORMATEX) ) 
     175        p_sys->fmt.i_extra = __MIN( GetWLE( &p_wf->cbSize ), i_size - sizeof(WAVEFORMATEX) ); 
    175176    i_extended = 0; 
    176177