Mercurial > mplayer.hg
changeset 9596:7b4a17c415fb
Same behaviour as old code for short headers
author | rtognimp |
---|---|
date | Sat, 15 Mar 2003 19:40:52 +0000 |
parents | 6bf482d797b1 |
children | 05a2998c428e |
files | libmpdemux/demux_audio.c |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_audio.c Sat Mar 15 18:50:58 2003 +0000 +++ b/libmpdemux/demux_audio.c Sat Mar 15 19:40:52 2003 +0000 @@ -158,7 +158,7 @@ WAVEFORMATEX* w; int l; l = stream_read_dword_le(s); - if(l < sizeof(WAVEFORMATEX)) { + if(l < 16) { mp_msg(MSGT_DEMUX,MSGL_ERR,"[demux_audio] Bad wav header length: too short (%d)!!!\n",l); free_sh_audio(sh_audio); return 0; @@ -170,8 +170,10 @@ w->nAvgBytesPerSec = stream_read_dword_le(s); w->nBlockAlign = stream_read_word_le(s); w->wBitsPerSample = sh_audio->samplesize = stream_read_word_le(s); + l -= 16; + if (l > 0) { w->cbSize = stream_read_word_le(s); - l -= sizeof(WAVEFORMATEX); + l -= 2; if (w->cbSize > 0) if (l < w->cbSize) { mp_msg(MSGT_DEMUX,MSGL_ERR,"[demux_audio] truncated extradata (%d < %d)\n", @@ -182,6 +184,7 @@ stream_read(s,(char*)((char*)(w)+sizeof(WAVEFORMATEX)),w->cbSize); l -= w->cbSize; } + } if(verbose>0) print_wave_header(w); if(l)