OpenCut icon indicating copy to clipboard operation
OpenCut copied to clipboard

[BUG] Crash when playing uploaded video: Extension context invalidated and VideoFrame was garbage collected without being closed

Open iguzelofficial opened this issue 1 year ago • 1 comments

Platform

win 11

Browser

Chrome

Current Behavior

The application crashes when trying to play an uploaded video.

The browser console repeatedly logs:

Uncaught (in promise) Error: Extension context invalidated.

A VideoFrame was garbage collected without being closed.

Video playback does not work.

Expected Behavior

No response

Recurrence Probability

Always

Steps To Reproduce

  1. Open the application in the browser.

  2. Upload a video file.

  3. Attempt to play the uploaded video.

  4. Observe the browser console.

  5. The application crashes and the listed errors appear.

Anything else?

Bug Description When trying to play an uploaded video, the app crashes. In the console, I see two recurring errors:

Uncaught (in promise) Error: Extension context invalidated.

This seems to happen when the app tries to call wrappedSendMessage from polyfill.js. Possibly the extension/content script context is being invalidated while video playback is active.

A VideoFrame was garbage collected without being closed.

This indicates that VideoFrame objects are not being properly closed after use. According to the WebCodecs API, .close() must be called to release resources.

Steps to Reproduce

Upload a video

Try to play it

Observe console logs and crash

Expected Behavior

Video should play without crashing

VideoFrame resources should be released properly

Console Output

Uncaught (in promise) Error: Extension context invalidated. at polyfill.js:518:25 ... A VideoFrame was garbage collected without being closed.

Possible Fixes

Ensure .close() is called on every VideoFrame once processing is done

Investigate why wrappedSendMessage is called after the extension context is invalidated

iguzelofficial avatar Sep 04 '25 10:09 iguzelofficial

I also crashed Chrome when playing the video.

thucvu97 avatar Sep 06 '25 02:09 thucvu97