mirror of
https://github.com/mstorsjo/fdk-aac.git
synced 2025-01-09 14:13:50 +01:00
Use saturating adds to avoid overflow
When the addition overflowed, asserts were triggered later, where the values were assumed to be non-negative.
This commit is contained in:
parent
010c75901e
commit
6999980d67
@ -762,8 +762,8 @@ calculateSbrEnvelope (FIXP_DBL **RESTRICT YBufferLeft, /*! energy buffer left *
|
||||
/* save energies */
|
||||
pNrgLeft[j] = nrgLeft;
|
||||
pNrgRight[j] = nrgRight;
|
||||
envNrgLeft += nrgLeft;
|
||||
envNrgRight += nrgRight;
|
||||
envNrgLeft = fAddSaturate(envNrgLeft, nrgLeft);
|
||||
envNrgRight = fAddSaturate(envNrgRight, nrgRight);
|
||||
|
||||
} /* j */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user