MP4Box.js crashes with uncompressed audio.

Open
#467 2 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
40/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale

Research direction

The over-allocation happens in buildTrakSampleLists, which creates a JavaScript object per audio sample. Start by loading the linked PCM .mp4 through the test page test/filereader.html and tracing how the audio track's sample table is built versus a compressed track; the stsd sample-entry format marks uncompressed audio. Done means that track loads without the tab crashing while clients can still read sample data, ideally with a regression test.

Written by the indexing model from the issue text.

Description

bug

MP4Box attempts to create a javascript per audio sample when it references uncompressed PCM sample data. This is also quite common with Quicktime .mov files.

To reproduce the problem:

  1. Download this file: https://www.dropbox.com/scl/fi/2n9ewhxeo4r1h813abn59/500x500_30FPS_600s_HEVC_PCM.mp4?rlkey=9vyzx3s80ydsiwvbypgzrk0i6&dl=0
  2. Using the test page, https://gpac.github.io/mp4box.js/test/filereader.html hit the "Choose File" button, select the downloaded file, and when uploading finishes, select the "Load" button.
  3. If it doesn't crash the tab, just hit "Load" again and again.

Result: In Chrome: "Aw Snap!" Error code 5.

This is due to the buildTrakSampleLists creating a javascript object for each audio sample! MP4Box.js should detect uncompressed audio formats and allow the client to access those samples, without allocating excessive javascript memory.

Dominant language
TypeScript
Stars
2.5k
Forks
390
Avg merge
1d 17h
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from gpac/mp4box.js

All issues in gpac/mp4box.js

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.