Skip to content

refactor(format-context): add transfer method#212

Merged
tony-go merged 5 commits into
mainfrom
io-transfer
Mar 25, 2026
Merged

refactor(format-context): add transfer method#212
tony-go merged 5 commits into
mainfrom
io-transfer

Conversation

@tony-go

@tony-go tony-go commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Context

I saw users shooting themselves into their feet because of this used case:

  using io = new ffmpeg.IOContext(image)
  using inputFormatContext = new ffmpeg.InputFormatContext(io)

... which provokes a double free in the current implementation.

Proposal

Add a .transfer method to transfer ownership

tony-go added 3 commits March 25, 2026 12:09
Signed-off-by: Tony Gorez <gorez.tony@gmail.com>
Signed-off-by: Tony Gorez <gorez.tony@gmail.com>
Signed-off-by: Tony Gorez <gorez.tony@gmail.com>
Comment thread lib/io-context.js Outdated
Comment thread lib/io-context.js
Comment thread lib/format-context.js Outdated
Signed-off-by: Tony Gorez <gorez.tony@gmail.com>
@tony-go tony-go requested a review from kasperisager March 25, 2026 11:36
Comment thread lib/format-context.js Outdated
Signed-off-by: Tony Gorez <gorez.tony@gmail.com>
@tony-go tony-go requested a review from kasperisager March 25, 2026 13:29
@tony-go tony-go marked this pull request as ready for review March 25, 2026 13:29
@tony-go tony-go requested a review from a team March 25, 2026 13:29
@tony-go tony-go merged commit e218b0b into main Mar 25, 2026
13 checks passed
@tony-go tony-go deleted the io-transfer branch March 25, 2026 14:04
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

Successfully merging this pull request may close these issues.

2 participants