[FFmpeg-cvslog] ra144enc: avoid integer overflows.

Michael Niedermayer git at videolan.org
Mon Sep 10 21:14:40 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Sep 10 20:54:03 2012 +0200| [17b3251c6c6b6f514e8c2f5202c90686729293a8] | committer: Michael Niedermayer

ra144enc: avoid integer overflows.

The values are all positive but signed variables where used,
which overflowed.

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

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

 libavcodec/ra144enc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c
index ceae878..e0fb827 100644
--- a/libavcodec/ra144enc.c
+++ b/libavcodec/ra144enc.c
@@ -347,7 +347,8 @@ static void ra144_encode_subblock(RA144Context *ractx,
     float zero[BLOCKSIZE], cba[BLOCKSIZE], cb1[BLOCKSIZE], cb2[BLOCKSIZE];
     int16_t cba_vect[BLOCKSIZE];
     int cba_idx, cb1_idx, cb2_idx, gain;
-    int i, n, m[3];
+    int i, n;
+    unsigned m[3];
     float g[3];
     float error, best_error;
 



More information about the ffmpeg-cvslog mailing list