Skip to content

Commit

Permalink
taglib: fix readBlock
Browse files Browse the repository at this point in the history
Taglib doesn't handle partial reads.
  • Loading branch information
tguillem committed Jul 22, 2016
1 parent 2f66612 commit e54bc05
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/meta_engine/taglib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,11 @@ class VlcIostream : public IOStream
ByteVector readBlock(ulong length)
{
ByteVector res(length, 0);
int i_read = vlc_stream_ReadPartial( m_stream, res.data(), length);
ssize_t i_read = vlc_stream_Read( m_stream, res.data(), length);
if (i_read < 0)
return ByteVector::null;;
res.resize(i_read);
return ByteVector::null;
else if ((size_t)i_read != length)
res.resize(i_read);
return res;
}

Expand Down

0 comments on commit e54bc05

Please sign in to comment.