fix(video-edit): 读取ffmpeg输出时深拷贝避免detached ArrayBuffer

This commit is contained in:
root committed 2026-02-17 18:32:06 +08:00
1 parent 4f0e2726ee
commit f29e05a3a9
1 file changed
+4 -2
+4 -2
View File
@@ -703,11 +703,13 @@
async function ffmpegReadFile(ff, name) {
if (typeof ff.readFile === 'function') {
const out = await ff.readFile(name);
return out instanceof Uint8Array ? out : new Uint8Array(out);
const view = out instanceof Uint8Array ? out : new Uint8Array(out);
return new Uint8Array(view);
}
if (ff.FS) {
const out = ff.FS('readFile', name);
return out instanceof Uint8Array ? out : new Uint8Array(out);
const view = out instanceof Uint8Array ? out : new Uint8Array(out);
return new Uint8Array(view);
}
throw new Error('ffmpeg_readfile_unsupported');
}