Correctly signal EOF when demuxing caf files.

This commit is contained in:
Carl Eugen Hoyos 2012-11-20 22:04:03 +01:00
parent 52b7823b73
commit b1e190d0fd

View File

@ -348,7 +348,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
/* don't read past end of data chunk */
if (caf->data_size > 0) {
left = (caf->data_start + caf->data_size) - avio_tell(pb);
if (left <= 0)
if (!left)
return AVERROR_EOF;
if (left < 0)
return AVERROR(EIO);
}