Commit 932e6a5a authored by Alex Converse's avatar Alex Converse

Fix an integer overflow in the AAC encoder.

Originally committed as revision 19470 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 87a84431
......@@ -72,8 +72,8 @@ static void quantize_bands(int (*out)[2], const float *in, const float *scaled,
double qc;
for (i = 0; i < size; i++) {
qc = scaled[i] * Q34;
out[i][0] = (int)FFMIN((int)qc, maxval);
out[i][1] = (int)FFMIN((int)(qc + 0.4054), maxval);
out[i][0] = (int)FFMIN(qc, (double)maxval);
out[i][1] = (int)FFMIN(qc + 0.4054, (double)maxval);
if (is_signed && in[i] < 0.0f) {
out[i][0] = -out[i][0];
out[i][1] = -out[i][1];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment