From d7366d918ff89e1e5b1ad0d33e688e4484c9c35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Wed, 5 Oct 2011 23:44:46 +0200 Subject: [PATCH] libmodplug: handle EOF correctly. --- libavformat/libmodplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/libmodplug.c b/libavformat/libmodplug.c index b4978b9c2d..9fc2ec9384 100644 --- a/libavformat/libmodplug.c +++ b/libavformat/libmodplug.c @@ -74,7 +74,7 @@ static int modplug_read_packet(AVFormatContext *s, AVPacket *pkt) pkt->size = ModPlug_Read(modplug->f, pkt->data, 512); if (pkt->size <= 0) { av_free_packet(pkt); - return AVERROR(EIO); + return pkt->size == 0 ? AVERROR_EOF : AVERROR(EIO); } return 0; }