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