summaryrefslogtreecommitdiff
path: root/libavformat/mvi.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mvi.c')
-rw-r--r--libavformat/mvi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mvi.c b/libavformat/mvi.c
index ff5c08bf51..06c9cfe3f0 100644
--- a/libavformat/mvi.c
+++ b/libavformat/mvi.c
@@ -123,6 +123,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
count = (mvi->audio_size_counter + mvi->audio_frame_size + 512) >> MVI_FRAC_BITS;
if (count > mvi->audio_size_left)
count = mvi->audio_size_left;
+ if ((int64_t)count << MVI_FRAC_BITS > INT_MAX)
+ return AVERROR_INVALIDDATA;
if ((ret = av_get_packet(pb, pkt, count)) < 0)
return ret;
pkt->stream_index = MVI_AUDIO_STREAM_INDEX;