[FFmpeg-cvslog] avcodec/mpegaudioenc_template: Fix integer overflow

Michael Niedermayer git at videolan.org
Tue Apr 15 15:18:16 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Apr 15 15:09:57 2014 +0200| [c6902f96d75b9786ddc1404c14349d6a22b7ed05] | committer: Michael Niedermayer

avcodec/mpegaudioenc_template: Fix integer overflow

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c6902f96d75b9786ddc1404c14349d6a22b7ed05
---

 libavcodec/mpegaudioenc_template.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegaudioenc_template.c b/libavcodec/mpegaudioenc_template.c
index ec837f3..e9571d8 100644
--- a/libavcodec/mpegaudioenc_template.c
+++ b/libavcodec/mpegaudioenc_template.c
@@ -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)



More information about the ffmpeg-cvslog mailing list