Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Size 0 doesn't always mean an invalid flac file, so ignore rather than fail. #45

Open
tweedj opened this issue Jul 8, 2023 · 0 comments
Labels

Comments

@tweedj
Copy link

tweedj commented Jul 8, 2023

I've found that scanning my Flac library there are some albums that fail with audio_metadata. Even though these files pass a 'flac -t FILE' they fail to extract with audio_metadata.
I've found that some of these files fail because of a ZERO size in a block, which is caught and triggers an exception.
While this is probably wanted behaviour for the STREAMINFO block, it seems a bit over zealous for blocks like, PADDING and SEEKTABLE.

So rather than call it a bug, I'll ask for a feature change. It requires a 1 (or2) line change in flac.py.

E.g. (Where flay.py in Downloads is the GitHub version)

[2041]$ diff  flac.py ~/Downloads/flac.py 
456,457c456,457
< 		if ( block_size == 0 ) and ( block_type == FLACMetadataBlockType.STREAMINFO ) :
< 			raise FormatError(f"FLAC metadata block {block_type}; size must be greater than 0.")
---
> 		if block_size == 0:
> 			raise FormatError("FLAC metadata block size must be greater than 0.")

@tweedj tweedj added the feature label Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant