mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Fix crash when loading an empty mpeg file (#830)
When loading an empty file (empty.txt -> empty.mp3 ), TagLib will crash. buffer.size() is 0, then buffer.size() - 1 is undefined (unsigned int)
This commit is contained in:
parent
cb9f07d9dc
commit
249f892455
@ -108,6 +108,9 @@ bool MPEG::File::isSupported(IOStream *stream)
|
||||
long headerOffset;
|
||||
const ByteVector buffer = Utils::readHeader(stream, bufferSize(), true, &headerOffset);
|
||||
|
||||
if(buffer.isEmpty())
|
||||
return false;
|
||||
|
||||
const long originalPosition = stream->tell();
|
||||
AdapterFile file(stream);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user