comparison 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
comparison
equal deleted inserted replaced
35256:4ca7b3dfb574 35257:9a46ec65165d
148 148
149 // printf("\nFOURCC: 0x%X\n",sh_audio->format); 149 // printf("\nFOURCC: 0x%X\n",sh_audio->format);
150 if(sh_audio->format==0x3343414D){ 150 if(sh_audio->format==0x3343414D){
151 // MACE 3:1 151 // MACE 3:1
152 sh_audio->ds->ss_div = 2*3; // 1 samples/packet 152 sh_audio->ds->ss_div = 2*3; // 1 samples/packet
153 sh_audio->ds->ss_mul = 2*sh_audio->wf->nChannels; // 1 byte*ch/packet 153 sh_audio->ds->ss_mul = sh_audio->wf ? 2*sh_audio->wf->nChannels : 2; // 1 byte*ch/packet
154 } else 154 } else
155 if(sh_audio->format==0x3643414D){ 155 if(sh_audio->format==0x3643414D){
156 // MACE 6:1 156 // MACE 6:1
157 sh_audio->ds->ss_div = 2*6; // 1 samples/packet 157 sh_audio->ds->ss_div = 2*6; // 1 samples/packet
158 sh_audio->ds->ss_mul = 2*sh_audio->wf->nChannels; // 1 byte*ch/packet 158 sh_audio->ds->ss_mul = sh_audio->wf ? 2*sh_audio->wf->nChannels : 2; // 1 byte*ch/packet
159 } 159 }
160 160
161 // Decode at least 1 byte: (to get header filled) 161 // Decode at least 1 byte: (to get header filled)
162 do { 162 do {
163 x=decode_audio(sh_audio,sh_audio->a_buffer,1,sh_audio->a_buffer_size); 163 x=decode_audio(sh_audio,sh_audio->a_buffer,1,sh_audio->a_buffer_size);