cast size to int64_t to avoid overflow
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sat, 30 May 2009 04:08:43 +0000 (04:08 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sat, 30 May 2009 04:08:43 +0000 (04:08 +0000)
Originally committed as revision 18991 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/utils.c

index bdf168a..c39f76b 100644 (file)
@@ -600,7 +600,7 @@ static int get_audio_frame_size(AVCodecContext *enc, int size)
             /* used for example by ADPCM codecs */
             if (enc->bit_rate == 0)
                 return -1;
-            frame_size = (size * 8 * enc->sample_rate) / enc->bit_rate;
+            frame_size = ((int64_t)size * 8 * enc->sample_rate) / enc->bit_rate;
         }
     } else {
         frame_size = enc->frame_size;