Skip to content

fix: prevent OOM crash in audio waveform generation (#1501)#1538

Open
AdityaDagar000 wants to merge 1 commit into
magic-peach:mainfrom
AdityaDagar000:fix/oom-audio-waveform
Open

fix: prevent OOM crash in audio waveform generation (#1501)#1538
AdityaDagar000 wants to merge 1 commit into
magic-peach:mainfrom
AdityaDagar000:fix/oom-audio-waveform

Conversation

@AdityaDagar000
Copy link
Copy Markdown

Fixes #1501

What changed

  • Added a 500 MB file size guard — skips waveform generation for very large files
  • Peaks are extracted immediately after decode and the full AudioBuffer is released for GC
  • AudioContext is properly closed after use to free Web Audio resources
  • Added a cancelled flag to handle cleanup when the file changes mid-decode
  • Added graceful error state

Root cause

file.arrayBuffer() was loading the entire file into memory, and the decoded
AudioBuffer was being held in state — causing OOM crashes on large audio files.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

@AdityaDagar000 is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

✅ PR Format Check Passed — @AdityaDagar000

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

👋 Thanks for your PR, @AdityaDagar000!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions github-actions Bot added level:intermediate Intermediate level - 35 pts type:bug Bug fix type:refactor Code refactor labels Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:intermediate Intermediate level - 35 pts type:bug Bug fix type:refactor Code refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Out-of-Memory (OOM) Crash Vulnerability in Audio Waveform Generation

1 participant