diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 128f14b746..4f62da3b9d 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -389,6 +389,9 @@ static int ogg_read_page(AVFormatContext *s, int *sid) avio_skip(bc, 8); /* seq, crc */ nsegs = avio_r8(bc); + if (avio_feof(bc)) + return AVERROR_EOF; + idx = ogg_find_stream(ogg, serial); if (idx < 0) { if (data_packets_seen(ogg))