Skip to content

Maxing out the number of PICTURES flac.exe can handle: "ERROR: 2 consecutive FLAC__STREAM_DECODER_END_OF_STREAM events." #821

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

Open
H2Swine opened this issue Mar 16, 2025 · 2 comments

Comments

@H2Swine
Copy link
Contributor

H2Swine commented Mar 16, 2025

Corner case, surely. Attachment has 1021 pictures, running successive re-encodings with many at the time. Using 1.5.0 for Windows.

  • Trying to run another flac -f --picture to add one more, yields "ERROR: 2 consecutive FLAC__STREAM_DECODER_END_OF_STREAM events." We are way below the max metadata size; Mp3tag can add more, and flac -t validates.
  • Also, and "maybe worse" is refusing without warning: Somewhere 960 to 1020 pictures added, running another it simply does not add any.

It seems something has changed over the years. 1.2.1 returns " ERROR: while decoding FLAC input, state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC"

ManyPictures1frame.zip

(Also I see that only 64 can be added at the time, but exceeding that gives an appropriate error message.)

@ktmf01
Copy link
Collaborator

ktmf01 commented Mar 16, 2025

I'm pretty sure the culprit is here

FLAC__StreamMetadata *metadata_blocks[1024]; /*@@@ BAD MAGIC number */

As you might understand, this has a low priority

@H2Swine
Copy link
Contributor Author

H2Swine commented Mar 17, 2025

Understandable. I also see that metaflac can exceed that bound.

And meanwhile, I notice what ffmpeg does:

[flac @ 00000185f096b640] Number of streams exceeds max_streams parameter (1000), see the documentation if you wish to increase it
[flac @ 00000185f096b640] Error parsing attached picture.
[in#0 @ 00000185f095f880] Error opening input: Cannot allocate memory
Error opening input file 4sec-silence.flac-ffmpeg.flac.
Error opening input files: Cannot allocate memory

"see the documentation" rather than offering the information of a simple -max_streams <highernumber> . So, asking trouble.

Close if you find appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants