Unbreak PS audio (#51)
This reverts commit 3b80a57483a6bc822d3ce3cc640fa81737a87c54.
François Cartegnie authored 3 years ago
GitHub committed 3 years ago
914 | 914 | /* element_output_channels not set yet */ |
915 | 915 | hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels; |
916 | 916 | } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != output_channels) { |
917 | /* element inconsistency | |
918 | * this only happens if PS is actually found but not in the first frame | |
917 | /* element inconsistency */ | |
918 | ||
919 | /* this only happens if PS is actually found but not in the first frame | |
919 | 920 | * this means that there is only 1 bitstream element! |
920 | 921 | */ |
921 | 922 | |
922 | if (hDecoder->fr_channels == 1) { | |
923 | /* reset the allocation */ | |
924 | hDecoder->element_alloced[hDecoder->fr_ch_ele] = 0; | |
925 | hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels; | |
926 | } else { | |
927 | return 21; | |
928 | } | |
923 | /* reset the allocation */ | |
924 | hDecoder->element_alloced[hDecoder->fr_ch_ele] = 0; | |
925 | ||
926 | hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels; | |
927 | ||
928 | //return 21; | |
929 | 929 | } |
930 | 930 | |
931 | 931 | if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0) |
937 | 937 | hDecoder->element_alloced[hDecoder->fr_ch_ele] = 1; |
938 | 938 | } |
939 | 939 | |
940 | /* sanity check, CVE-2018-20199, CVE-2018-20360 */ | |
941 | if(!hDecoder->time_out[sce->channel]) | |
942 | return 15; | |
940 | 943 | |
941 | 944 | /* dequantisation and scaling */ |
942 | 945 | retval = quant_to_spec(hDecoder, ics, spec_data, spec_coef, hDecoder->frameLength); |
1116 | 1119 | |
1117 | 1120 | hDecoder->element_alloced[hDecoder->fr_ch_ele] = 2; |
1118 | 1121 | } |
1122 | ||
1123 | /* sanity check, CVE-2018-20199, CVE-2018-20360 */ | |
1124 | if(!hDecoder->time_out[cpe->channel]) | |
1125 | return 15; | |
1119 | 1126 | |
1120 | 1127 | /* dequantisation and scaling */ |
1121 | 1128 | retval = quant_to_spec(hDecoder, ics1, spec_data1, spec_coef1, hDecoder->frameLength); |