mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 13:10:26 -04:00
Fix memory leaks in the FLAC parsing code
Thanks to Daniel Schaack for reporting these.
This commit is contained in:
parent
f89c16cd65
commit
5685dd078f
@ -65,13 +65,13 @@ public:
|
||||
hasID3v2(false),
|
||||
hasID3v1(false)
|
||||
{
|
||||
for(uint i = 0; i < blocks.size(); i++) {
|
||||
delete blocks[i];
|
||||
}
|
||||
}
|
||||
|
||||
~FilePrivate()
|
||||
{
|
||||
for(uint i = 0; i < blocks.size(); i++) {
|
||||
delete blocks[i];
|
||||
}
|
||||
delete properties;
|
||||
}
|
||||
|
||||
@ -403,6 +403,7 @@ void FLAC::File::scan()
|
||||
}
|
||||
else {
|
||||
debug("FLAC::File::scan() -- invalid picture found, discarting");
|
||||
delete picture;
|
||||
}
|
||||
}
|
||||
|
||||
@ -412,6 +413,9 @@ void FLAC::File::scan()
|
||||
if(block->code() != MetadataBlock::Padding) {
|
||||
d->blocks.append(block);
|
||||
}
|
||||
else {
|
||||
delete block;
|
||||
}
|
||||
|
||||
nextBlockOffset += length + 4;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user