Commit a11cc336 authored by Laurent Aimar's avatar Laurent Aimar

Fixed segfault on corrupted wav file.

parent 26d305ed
...@@ -171,7 +171,8 @@ static int Open( vlc_object_t * p_this ) ...@@ -171,7 +171,8 @@ static int Open( vlc_object_t * p_this )
p_sys->fmt.audio.i_blockalign = GetWLE( &p_wf->nBlockAlign ); p_sys->fmt.audio.i_blockalign = GetWLE( &p_wf->nBlockAlign );
p_sys->fmt.i_bitrate = GetDWLE( &p_wf->nAvgBytesPerSec ) * 8; p_sys->fmt.i_bitrate = GetDWLE( &p_wf->nAvgBytesPerSec ) * 8;
p_sys->fmt.audio.i_bitspersample = GetWLE( &p_wf->wBitsPerSample ); p_sys->fmt.audio.i_bitspersample = GetWLE( &p_wf->wBitsPerSample );
p_sys->fmt.i_extra = GetWLE( &p_wf->cbSize ); if( i_size >= sizeof(WAVEFORMATEX) )
p_sys->fmt.i_extra = __MIN( GetWLE( &p_wf->cbSize ), i_size - sizeof(WAVEFORMATEX) );
i_extended = 0; i_extended = 0;
/* Handle new WAVE_FORMAT_EXTENSIBLE wav files */ /* Handle new WAVE_FORMAT_EXTENSIBLE wav files */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment