Skip to content

Commit

Permalink
Prevent taglib from corrupting flac files
Browse files Browse the repository at this point in the history
Prevent taglib from corrupting flac files when embedded album art exceeds 16Mb
  • Loading branch information
gchudov committed Nov 25, 2018
1 parent 2cab612 commit 8590ad0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/TagLib/Flac/BlockHeader.cs
Expand Up @@ -137,6 +137,10 @@ public BlockHeader (ByteVector data)
/// </param>
public BlockHeader (BlockType type, uint blockSize)
{
if (blockSize > 0xffffff)
throw new CorruptFileException (
"Block size too large.");

block_type = type;
is_last_block = false;
block_size = blockSize;
Expand Down Expand Up @@ -194,4 +198,4 @@ public ByteVector Render (bool isLastBlock)
get {return block_size;}
}
}
}
}

0 comments on commit 8590ad0

Please sign in to comment.