diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 7ace0d1c16..91357dc922 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -369,6 +369,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))