Check chain length Ogg FLAC file
When a metadata chain was read from an Ogg FLAC file containing no metadata (but otherwise valid), an empty chain could be returned, leading to null derefencing on trying to manipulate it. This commit adds a check for the chain length
This commit is contained in:
parent
46f3f36772
commit
b963ce0873
@ -1360,6 +1360,12 @@ static FLAC__bool chain_read_ogg_cb_(FLAC__Metadata_Chain *chain, FLAC__IOHandle
|
||||
|
||||
chain->initial_length = chain_calculate_length_(chain);
|
||||
|
||||
if(chain->initial_length == 0) {
|
||||
/* Ogg FLAC file must have at least streaminfo and vorbis comment */
|
||||
chain->status = FLAC__METADATA_CHAIN_STATUS_BAD_METADATA;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user