LOCAL CORE JAVASCRIPT BINDING PATCH Patch ID: ffprobe-return-value-v1 Modified: 2026-10-04 Upstream: @ffmpeg/core 0.12.10 from ffmpeg.wasm release v12.15 Upstream commit: 71aa99d37c02a7b4c435275ca9ef50e612f6efa1 Distributed target: /video-engine/0.12.10/ffmpeg-core.js Reason: The C ffprobe entry point normally returns `ret < 0` (0 on success, 1 on failure) without calling cmdutils exit_program. The original JavaScript binding ignored that return value and returned Module.ret, whose reset value is -1. The FFmpeg class worker in @ffmpeg/ffmpeg 0.12.15 reads Module.ret. Therefore a successful probe was reported as -1, and a normal error return could also be reported as -1. The patch stores the C return in Module.ret on normal return. The existing exception handling is preserved: an exit_program/abort path sets Module.ret before throwing, and this assignment does not execute on that path. The processor continues requiring status 0; it does not treat -1 as success. Scope: Only the distributed ESM ffmpeg-core.js copy is changed. The npm package, ffmpeg-core.wasm, MIT class wrapper and other files remain unchanged. The patch is applied by scripts/prepare-video-engine.mjs and must match exactly one occurrence, failing closed for an unexpected upstream file. The full original bind.js is in the provided ffmpeg.wasm source archive. The complete modified source is build-reference/patched-bind.js. The prepared script source is published as build-reference/prepare-video-engine.mjs. These modified sources remain subject to their upstream applicable licenses. They do not complete the separately documented full-core corresponding-source collection obligation. Exact generated/minified old text: Module["_ffprobe"](args.length,stringsToPtr(args)) Exact generated/minified new text: Module["ret"]=Module["_ffprobe"](args.length,stringsToPtr(args)) Full original source function: function ffprobe(..._args) { const args = [...Module["DEFAULT_ARGS_FFPROBE"], ..._args]; try { Module["_ffprobe"](args.length, stringsToPtr(args)); } catch (e) { if (!e.message.startsWith("Aborted")) { throw e; } } return Module["ret"]; } Full modified source function: function ffprobe(..._args) { const args = [...Module["DEFAULT_ARGS_FFPROBE"], ..._args]; try { Module["ret"] = Module["_ffprobe"](args.length, stringsToPtr(args)); } catch (e) { if (!e.message.startsWith("Aborted")) { throw e; } } return Module["ret"]; } Original core JS SHA-256: 67a48f11645f85439f3fde4f2119042c16b374b910206b7a7a24f342e28dcae3 Patched distributed core JS SHA-256: 9842e9f87eb4e86557b5335101c5b4a5a2f8873eba355a07f51d34bd3d63364b Original core JS bytes: 111804 Patched core JS bytes: 111818