FFmpeg/FFmpeg at 946272b · static read-only analysis · why-not-rust method 2.0FFmpeg/FFmpeg @ 946272b · 只读静态分析 · why-not-rust 方法 2.0
Repository: github.com/FFmpeg/FFmpeg at commit 946272b, shallow clone, 10,511 tracked files. Scope: the whole repository, with the libavformat demux/parse layer as the selected component. Sampling: 1,567,523 lines of C, 260,067 of headers, 110,661 in .S and 83,617 in .asm files, for 2,021,868 lines total; libavcodec 999,497; libavformat 272,807, of which 59,433 across 142 files are demux. Module counts come from the registration tables: 368 extern const FFInputFormat demuxer declarations in libavformat/allformats.c, and 604 extern const FFCodec decoder declarations in libavcodec/allcodecs.c. Per-directory figures count .c and .h together; the 1,567,523 figure is .c only, and each lens states which. The authorized scope is 59,433 lines of libavformat demux plus 13,032 lines of libavcodec bitstream parsers, 72,465 in total across 210 files. No build, test, benchmark or network call was run against the project. Objective: eliminate the memory-unsafety class at the point FFmpeg first interprets attacker-controlled bytes, without changing decode output or losing SIMD throughput. User-supplied facts: none. D2 is recorded UNKNOWN, not estimated. No public profile separates time in SIMD kernels from time in C control flow, and converting the 3.6% line share into a speedup would be a method error. The full-rewrite option therefore carries no benefit interval instead of a favourable one. This is a structured decision protocol, not a statistical predictor.仓库:github.com/FFmpeg/FFmpeg,commit 946272b,浅克隆,10,511 个纳入版本管理的文件。范围:整个仓库,选定组件是 libavformat 的 demux/parse 层。采样:C 1,567,523 行,头文件 260,067 行,.S 文件 110,661 行,.asm 文件 83,617 行,合计 2,021,868 行;libavcodec 999,497 行;libavformat 272,807 行,其中 142 个文件、59,433 行属于 demux。模块数量取自注册表:libavformat/allformats.c 中 368 条 extern const FFInputFormat demuxer 声明,libavcodec/allcodecs.c 中 604 条 extern const FFCodec decoder 声明。按目录统计的数字把 .c 和 .h 一起计入;1,567,523 这个数字只算 .c,每个维度都会写明用的是哪一种。授权范围是 libavformat demux 的 59,433 行,加 libavcodec bitstream parser 的 13,032 行,合计 72,465 行,分布在 210 个文件中。没有对该项目执行任何构建、测试、基准或网络调用。目标:在 FFmpeg 首次解释攻击者控制的字节的地方消除内存不安全这一整类缺陷,同时不改变解码输出,也不损失 SIMD 吞吐。用户提供的事实:无。D2 记为 UNKNOWN,不做估算:没有公开剖析把 SIMD kernel 的时间与 C 控制流的时间分开,把 3.6% 的行数占比换算成加速比属于方法错误。全量重写方案因此没有收益区间,而不是拿到一个好看的区间。这是一套结构化的决策流程,不是统计预测器。
| What we don't know证据缺口 | What it would change会改变什么 |
| Per-component attribution of FFmpeg's CVE ledgerFFmpeg CVE 记录的按组件归因 | Format selection currently rests on structural exposure. With attribution, step 1 gets a defensible first target; without it, the first module may be the wrong one.格式挑选目前靠结构性暴露面。有了归因,第 1 步就能给出站得住的首个目标;没有的话,第一个模块可能选错。 |
| Measured per-packet boundary cost at the module interface模块接口上逐 packet 边界成本的实测 | If crossing cost is material, the seam is wrong even though the objective is right, and the option reverts to sandboxing plus fuzzing.如果穿越成本大到要紧,接缝就是错的,哪怕目标是对的,方案会退回沙箱加模糊测试。 |
| End-to-end decode profile separating asm from C把汇编和 C 分开的端到端解码剖析 | Absent this, the performance half of any full-rewrite proposal stays UNKNOWN and that option keeps an empty benefit interval.没有它,任何全量重写提案里性能那一半都保持 UNKNOWN,那个方案的收益区间也一直是空的。 |