diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index ba3930c261..ad1c863d2c 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -613,7 +613,7 @@ static int64_t find_guid(AVIOContext *pb, const uint8_t guid1[16]) while (!avio_feof(pb)) { avio_read(pb, guid, 16); size = avio_rl64(pb); - if (size <= 24) + if (size <= 24 || size > INT64_MAX - 8) return AVERROR_INVALIDDATA; if (!memcmp(guid, guid1, 16)) return size;