mirror of
https://github.com/taglib/taglib.git
synced 2025-06-03 17:18:11 -04:00
avoid freezes reading incomplete mp3 files
This commit is contained in:
parent
91b00b17b2
commit
7db76720bb
@ -109,7 +109,7 @@ bool MPEG::File::isSupported(IOStream *stream)
|
||||
const ByteVector buffer = Utils::readHeader(stream, bufferSize(), true, &headerOffset);
|
||||
|
||||
if(buffer.isEmpty())
|
||||
return false;
|
||||
return false;
|
||||
|
||||
const long originalPosition = stream->tell();
|
||||
AdapterFile file(stream);
|
||||
@ -476,6 +476,9 @@ long MPEG::File::lastFrameOffset()
|
||||
else
|
||||
position = length();
|
||||
|
||||
if (position > length()) //if the file is incomplete
|
||||
position = length();
|
||||
|
||||
return previousFrameOffset(position);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user