diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 061d904dfe..13f077cb58 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -765,6 +765,8 @@ smv_out: goto smv_retry; return AVERROR_EOF; } + if (INT64_MAX - left < avio_tell(s->pb)) + return AVERROR_INVALIDDATA; wav->data_end = avio_tell(s->pb) + left; }