YuLi
|
867fc9ce83
|
fix: harden AAC RTP decoder payload bounds checks (#4788)
### Motivation
- 修复 `ext-codec/AACRtp.cpp` 中的越界读取问题,避免在处理异常短的 AAC RTP payload 时读取
`ptr[1]` 导致堆越界(CWE-125)。
- 在解码器层对输入数据做前置且严格的长度校验以防止网络可达的、未认证或畸形的 RTP 包触发服务可用性影响。
### Description
- 在 `AACRtpDecoder::inputRtp` 中对 `payload_size` 强制要求至少为 2 字节以保障对
AU-Header-Length 的安全读取。
- 添加对 AU-header 表的完整性检查:计算 `au_headers_size = au_header_count * 2` 并在访问
AU-header 或做指针偏移前验证可用字节,否则拒绝该包。
- 在 `flushData()` 中将帧长度判断移到前面,先检查 `_frame->size() > ADTS_HEADER_LEN` 再访问
`ptr[0]`/`ptr[1]`,避免短帧情况下的顺序求值导致的越界读取。
### Testing
- 运行 `git diff --check`,无格式/冲突检查错误并通过。
- 运行配置命令 `cmake -S . -B build -DENABLE_TESTS=OFF -DENABLE_WEBRTC=OFF
-DENABLE_SRT=OFF -DENABLE_FFMPEG=OFF -DCMAKE_BUILD_TYPE=Debug`,CMake
配置成功。
- 运行构建 `cmake --build build --target zlmediakit -j2`,目标构建完成且
`zlmediakit` 目标成功编译。
------
[Codex
Task](https://chatgpt.com/codex/cloud/tasks/task_e_6a63e2a088ac8320ac3864716f13c995)
|
2026-07-27 22:50:23 +08:00 |
|
alex
|
4152dcd409
|
AI automatically translates all comments in the code into English (#3917)
|
2024-09-19 14:53:50 +08:00 |
|
xia-chu
|
9463d1291d
|
修复编译警告
|
2024-07-21 19:47:36 +08:00 |
|
xiongziliang
|
3de2ee7a2b
|
优化aac rtp解码器内存安全限定
|
2024-06-16 09:34:39 +08:00 |
|
xiongziliang
|
720d6304d2
|
修复aac rtp解码兼容性相关bug
|
2024-06-15 15:11:36 +08:00 |
|
xia-chu
|
25c99470ee
|
feat: add support of codec plugin
|
2023-12-10 11:09:04 +08:00 |
|