mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
FLAC: Validate the size of a read
Without this we can crash trying to dereference parts of `header`.
This commit is contained in:
parent
1644c0dd87
commit
3391bd80c4
@ -497,6 +497,11 @@ void FLAC::File::scan()
|
||||
|
||||
seek(nextBlockOffset);
|
||||
const ByteVector header = readBlock(4);
|
||||
if(header.size() != 4) {
|
||||
debug("FLAC::File::scan() -- Failed to read a block header");
|
||||
setValid(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Header format (from spec):
|
||||
// <1> Last-metadata-block flag
|
||||
|
Loading…
x
Reference in New Issue
Block a user