Mercurial > mplayer.hg
diff libmpcodecs/ad_ffmpeg.c @ 35257:9a46ec65165d
Fix potential NULL dereference.
| author | reimar |
|---|---|
| date | Mon, 05 Nov 2012 21:02:38 +0000 |
| parents | 2b037cee0795 |
| children | 6d9e9c6d3cab |
line wrap: on
line diff
--- a/libmpcodecs/ad_ffmpeg.c Mon Nov 05 20:58:38 2012 +0000 +++ b/libmpcodecs/ad_ffmpeg.c Mon Nov 05 21:02:38 2012 +0000 @@ -150,12 +150,12 @@ if(sh_audio->format==0x3343414D){ // MACE 3:1 sh_audio->ds->ss_div = 2*3; // 1 samples/packet - sh_audio->ds->ss_mul = 2*sh_audio->wf->nChannels; // 1 byte*ch/packet + sh_audio->ds->ss_mul = sh_audio->wf ? 2*sh_audio->wf->nChannels : 2; // 1 byte*ch/packet } else if(sh_audio->format==0x3643414D){ // MACE 6:1 sh_audio->ds->ss_div = 2*6; // 1 samples/packet - sh_audio->ds->ss_mul = 2*sh_audio->wf->nChannels; // 1 byte*ch/packet + sh_audio->ds->ss_mul = sh_audio->wf ? 2*sh_audio->wf->nChannels : 2; // 1 byte*ch/packet } // Decode at least 1 byte: (to get header filled)
