avcodec/mpegaudioenc_template: Fix integer overflow
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 15 Apr 2014 13:09:57 +0000 (15:09 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 15 Apr 2014 13:09:57 +0000 (15:09 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mpegaudioenc_template.c

index ec837f3..e9571d8 100644 (file)
@@ -708,7 +708,7 @@ static void encode_frame(MpegAudioContext *s,
                                 q1 += 1 << P;
                                 if (q1 < 0)
                                     q1 = 0;
-                                q[m] = (unsigned)(q1 * steps) >> (P + 1);
+                                q[m] = (q1 * (unsigned)steps) >> (P + 1);
                             }
 #endif
                             if (q[m] >= steps)