diff --git a/libavformat/utils.c b/libavformat/utils.c
index bdf168ae93baa6d974f7e799f8bf0a952f696b79..c39f76bf6331ab43e9b09e6997031cd87a71ecc9 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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;