{"record":{"id":"0992aa034670b8ec","repo":"diegosouzapw/OmniRoute","slug":"extracted-video-frame-changed-before-it-could-be-r","errorCode":null,"errorMessage":"Extracted video frame changed before it could be read","messagePattern":"Extracted video frame changed before it could be read","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/guardrails/videoBridgeRuntime.ts","lineNumber":950,"sourceCode":"  let totalBytes = 0;\n  const sizes: number[] = [];\n  for (const frame of frames) {\n    const metadata = await stat(frame.path);\n    if (!metadata.isFile() || metadata.size < 1 || metadata.size > maxFrameBytes) {\n      throw new Error(\"Extracted video frame byte limit exceeded\");\n    }\n    totalBytes += metadata.size;\n    if (totalBytes > maxTotalBytes) {\n      throw new Error(\"Extracted video total frame byte limit exceeded\");\n    }\n    sizes.push(metadata.size);\n  }\n\n  const output: Buffer[] = [];\n  for (let index = 0; index < frames.length; index++) {\n    const bytes = await readFile(frames[index].path);\n    if (bytes.byteLength !== sizes[index]) {\n      throw new Error(\"Extracted video frame changed before it could be read\");\n    }\n    output.push(bytes);\n  }\n  return output;\n}\n\nexport async function extractVideoFramesFromBytes(\n  bytes: Uint8Array,\n  options: {\n    frameCount: number;\n    focusWindow?: VideoFocusBounds | null;\n    maxDurationSeconds: number;\n    runner?: VideoCommandRunner;\n    samplingPolicy?: VideoSamplingPolicy;\n    signal?: AbortSignal;\n    timeoutMs: number;\n  }\n): Promise<{","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/guardrails/videoBridgeRuntime.ts#L932-L968","documentation":"Error \"Extracted video frame changed before it could be read\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/guardrails/videoBridgeRuntime.ts:950 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}