comparison libfaad2/specrec.c @ 28722:5f24919c13ef

Fix a possible NULL-pointer crash introduced by local changes to libfaad2
author reimar
date Sat, 28 Feb 2009 10:06:52 +0000
parents 0783dd397f74
children e83eef58b30a
comparison
equal deleted inserted replaced
28721:267dd38c800e 28722:5f24919c13ef
845 output_channels = hDecoder->ps_used[hDecoder->fr_ch_ele] ? 2 : 1; 845 output_channels = hDecoder->ps_used[hDecoder->fr_ch_ele] ? 2 : 1;
846 #else 846 #else
847 output_channels = 1; 847 output_channels = 1;
848 #endif 848 #endif
849 849
850 if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] < output_channels) { 850 if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0 ||
851 hDecoder->element_output_channels[hDecoder->fr_ch_ele] < output_channels) {
851 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels; 852 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
852 retval = allocate_single_channel(hDecoder, sce->channel, output_channels); 853 retval = allocate_single_channel(hDecoder, sce->channel, output_channels);
853 if (retval > 0) 854 if (retval > 0)
854 return retval; 855 return retval;
855 856