Commit d7366d91 authored by Clément Bœsch's avatar Clément Bœsch

libmodplug: handle EOF correctly.

parent d9b60687
...@@ -74,7 +74,7 @@ static int modplug_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -74,7 +74,7 @@ static int modplug_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->size = ModPlug_Read(modplug->f, pkt->data, 512); pkt->size = ModPlug_Read(modplug->f, pkt->data, 512);
if (pkt->size <= 0) { if (pkt->size <= 0) {
av_free_packet(pkt); av_free_packet(pkt);
return AVERROR(EIO); return pkt->size == 0 ? AVERROR_EOF : AVERROR(EIO);
} }
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment