[FFmpeg-cvslog] r19470 - trunk/libavcodec/aaccoder.c

alexc subversion
Mon Jul 20 20:27:18 CEST 2009


Author: alexc
Date: Mon Jul 20 20:27:17 2009
New Revision: 19470

Log:
Fix an integer overflow in the AAC encoder.

Modified:
   trunk/libavcodec/aaccoder.c

Modified: trunk/libavcodec/aaccoder.c
==============================================================================
--- trunk/libavcodec/aaccoder.c	Mon Jul 20 12:45:03 2009	(r19469)
+++ trunk/libavcodec/aaccoder.c	Mon Jul 20 20:27:17 2009	(r19470)
@@ -72,8 +72,8 @@ static void quantize_bands(int (*out)[2]
     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];



More information about the ffmpeg-cvslog mailing list