{"record":{"id":"e722ac9a438a4dc7","repo":"remotion-dev/remotion","slug":"invalid-section-length-e722ac","errorCode":null,"errorMessage":"Invalid section length","messagePattern":"Invalid section length","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/transport-stream/parse-pmt.ts","lineNumber":84,"sourceCode":"\titerator.stopReadingBits();\n\n\treturn {\n\t\ttype: 'transport-stream-pmt-box',\n\t\ttableId,\n\t\tstreams: tables[0].streams,\n\t};\n};\n\nexport const parsePmt = (iterator: BufferIterator): TransportStreamPMTBox => {\n\titerator.startReadingBits();\n\n\tconst tableId = iterator.getBits(8);\n\titerator.getBits(1); // syntax indicator\n\titerator.getBits(1); // private bit\n\titerator.getBits(4);\n\tconst sectionLength = iterator.getBits(10);\n\tif (sectionLength > 1021) {\n\t\tthrow new Error('Invalid section length');\n\t}\n\n\titerator.stopReadingBits();\n\n\tconst tables = parsePmtTable({iterator, tableId, sectionLength});\n\tdiscardRestOfPacket(iterator);\n\treturn tables;\n};\n","sourceCodeStart":66,"sourceCodeEnd":93,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/transport-stream/parse-pmt.ts#L66-L93","documentation":"Thrown at parse-pmt.ts:84 when the PMT section_length field (10 bits) exceeds 1021 bytes. Same ISO/IEC 13818-1 constraint as the PAT: section_length is capped at 1021 because the maximum section payload plus CRC must fit in 1024 bytes.","triggerScenarios":"parsePmt reads the same bit layout as parsePat (1+1+1+4+10) and throws when sectionLength > 1021. Triggered by a corrupt PMT section header, a misrouted section, or a heavily multiplexed stream whose PMT payload is genuinely too large.","commonSituations":"Corrupted captures; faulty encoders; multi-program transport streams with large PMT descriptors; bit-flips in the length field.","solutions":["Re-mux the file: ffmpeg -i in.ts -c copy out.ts.","Verify with dvbsnoop or tsreader that the PMT section_length is within bounds.","Re-acquire the source if it is a damaged capture.","Transcode to a simpler container if the PMT descriptors are unusually large."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function isValidTs(src: string): boolean {\n  try { execSync(`ffprobe -v error -i \"${src}\" -t 1 -f null -`, {stdio: 'ignore'}); return true; } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"try { await parseMedia({src}); }\ncatch (e) { if (e instanceof Error && e.message === 'Invalid section length') { /* re-mux or reject */ } else throw e; }","preventionTips":["Pre-screen .ts inputs with ffprobe.","Re-mux suspect files with ffmpeg -c copy to normalize PMT headers.","Treat PMT section-length errors as fatal rather than retrying unchanged."],"tags":["media-parser","transport-stream","mpegts","pmt","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}