music-metadata icon indicating copy to clipboard operation
music-metadata copied to clipboard

parseFromTokenizer hangs (forever, rather than throwing) on duration error

Open charles-rc opened this issue 9 months ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

music-metadata version

7.14.0

JavaScript module eco system

CommonJS modules (CJS), music-medata ≤ version 7

Current Behavior

Hey!

Thanks for the library. It's awesome!

We noticed a bug recently where certain corrupt files cause parseFromTokenizer to infinitely hang. We're storing files in S3, creating a tokenizer and then running parseFromTokenizer. See the code below for an example:

  const s3Tokenizer = await makeTokenizer(s3Client, {
    Bucket: bucket,
    Key: key,
  });
  const metadata = await parseFromTokenizer(s3Client, { duration: true });

For files with corrupt duration, the above code does not throw or return a response. It just seems to hang indefinitely.

See this file for an example - corrupt_duration.mp3.zip

When loaded into Foobar2000 and then running the Verifier the file reports an error of "Failed: Reported length is inaccurate: 1:57 vs :1:33 decoded".

Expected Behavior

The library throws an error or returns an error response.

Attached audio sample?

  • [X] I have provided sufficient information to reproduce the issue

charles-rc avatar May 22 '24 13:05 charles-rc