mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 03:27:40 +01:00
Patch taglib to stop loading a FLAC file if it has too many metadata blocks. Fixes issue 3500.
This commit is contained in:
parent
115964d1b4
commit
446b379111
9
3rdparty/taglib/flac/flacfile.cpp
vendored
9
3rdparty/taglib/flac/flacfile.cpp
vendored
@ -416,9 +416,18 @@ void FLAC::File::scan()
|
||||
d->blocks.append(new UnknownMetadataBlock(blockType, d->streamInfoData));
|
||||
nextBlockOffset += length + 4;
|
||||
|
||||
int blockCount = 0;
|
||||
|
||||
// Search through the remaining metadata
|
||||
while(!isLastBlock) {
|
||||
|
||||
if (++blockCount > 1024) {
|
||||
debug("FLAC::File::scan() -- FLAC stream has more than 1024 metadata "
|
||||
"blocks, probably corrupt.");
|
||||
setValid(false);
|
||||
return;
|
||||
}
|
||||
|
||||
header = readBlock(4);
|
||||
blockType = header[0] & 0x7f;
|
||||
isLastBlock = (header[0] & 0x80) != 0;
|
||||
|
29
3rdparty/taglib/patches/01-too-many-flac-metadata-blocks.patch
vendored
Normal file
29
3rdparty/taglib/patches/01-too-many-flac-metadata-blocks.patch
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
commit 0b55f03fa092241dd4533ef0fd4a18b2d97a1b25
|
||||
Author: David Sansome <me@davidsansome.com>
|
||||
Date: Sun Feb 17 18:39:49 2013 +1100
|
||||
|
||||
Stop loading a FLAC file if it has too many metadata blocks.
|
||||
|
||||
diff --git a/3rdparty/taglib/flac/flacfile.cpp b/3rdparty/taglib/flac/flacfile.cpp
|
||||
index a02770a..d308256 100644
|
||||
--- a/3rdparty/taglib/flac/flacfile.cpp
|
||||
+++ b/3rdparty/taglib/flac/flacfile.cpp
|
||||
@@ -416,9 +416,18 @@ void FLAC::File::scan()
|
||||
d->blocks.append(new UnknownMetadataBlock(blockType, d->streamInfoData));
|
||||
nextBlockOffset += length + 4;
|
||||
|
||||
+ int blockCount = 0;
|
||||
+
|
||||
// Search through the remaining metadata
|
||||
while(!isLastBlock) {
|
||||
|
||||
+ if (++blockCount > 1024) {
|
||||
+ debug("FLAC::File::scan() -- FLAC stream has more than 1024 metadata "
|
||||
+ "blocks, probably corrupt.");
|
||||
+ setValid(false);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
header = readBlock(4);
|
||||
blockType = header[0] & 0x7f;
|
||||
isLastBlock = (header[0] & 0x80) != 0;
|
Loading…
x
Reference in New Issue
Block a user