summaryrefslogtreecommitdiff
path: root/libavcodec/aaccoder.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2009-07-20 18:27:17 +0000
committerAlex Converse <alex.converse@gmail.com>2009-07-20 18:27:17 +0000
commit932e6a5a4c78250e3cab4f65215214fb0dbf51f7 (patch)
tree6e150be9051d7e88fb6bc5c8471f4cc798e778e8 /libavcodec/aaccoder.c
parent87a844316ce4344965e73ef37d998c3094f2286b (diff)
Fix an integer overflow in the AAC encoder.
Originally committed as revision 19470 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r--libavcodec/aaccoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index 3b6ec96876..97a5912e4a 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -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];