mirror of https://github.com/mstorsjo/fdk-aac.git
Saturate additions in FDKaacEnc_IntensityStereoProcessing
This fixes a crash when encoding a sample from github issue #98.
This commit is contained in:
parent
69a9b1a051
commit
4d4845e1db
|
@ -747,9 +747,9 @@ void FDKaacEnc_IntensityStereoProcessing(
|
||||||
j++) {
|
j++) {
|
||||||
s = ((mdctSpectrumLeft[j] << s0) >> 1) +
|
s = ((mdctSpectrumLeft[j] << s0) >> 1) +
|
||||||
((mdctSpectrumRight[j] << s0) >> 1);
|
((mdctSpectrumRight[j] << s0) >> 1);
|
||||||
es += fMultDiv2(s, s) >>
|
es = fAddSaturate(es, fMultDiv2(s, s) >>
|
||||||
(MDCT_SPEC_SF -
|
(MDCT_SPEC_SF -
|
||||||
1); // scaled 2*(mdctScale - s0 + 1) + MDCT_SPEC_SF
|
1)); // scaled 2*(mdctScale - s0 + 1) + MDCT_SPEC_SF
|
||||||
}
|
}
|
||||||
msMask[sfb + sfboffs] = 0;
|
msMask[sfb + sfboffs] = 0;
|
||||||
tmp = fDivNorm(sfbEnergyLeft[sfb + sfboffs], es, &s1);
|
tmp = fDivNorm(sfbEnergyLeft[sfb + sfboffs], es, &s1);
|
||||||
|
|
Loading…
Reference in New Issue