aacpsy: avoid psy_band->threshold becoming NaN
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Thu, 16 Apr 2015 18:04:54 +0000 (20:04 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Jun 2015 00:13:10 +0000 (02:13 +0200)
commitc962405c1968c0bfb3271f225df3ccabcb683c0e
treee16444885932221fe128b7db6ac80ce016b2caf7
parent743973f56f94e12c9153c06b17fb59cac7ccda39
aacpsy: avoid psy_band->threshold becoming NaN

If band->thr is 0.0f, the division is undefined, making norm_fac not a
number or infinity, which causes psy_band->threshold to become NaN.

This is passed on to other variables until it finally reaches
sce->sf_idx and is converted to an integer (-2147483648).

This causes a segmentation fault when it is used as array index.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e224aa41917454e7b5c23d9f2541425743ce595a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/aacpsy.c