[BUG] read_exp_golomb_unsigned panics/aborts on 64 or more leading zero bits (malformed SPS)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Start in src/rust/lib_ccxr/src/common/bitstream.rs with read_exp_golomb_unsigned, then trace the C forwarding function in cc_bitstream.c and its use from seq_parameter_set_rbsp() in avc_functions.c. Add a unit test decoding 64 zero bits and check that malformed input returns a BitstreamError rather than panicking or terminating the process; verify the SPS path can skip the NAL.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
BitStreamRust::read_exp_golomb_unsigned (src/rust/lib_ccxr/src/common/bitstream.rs) does not limit the number of leading zero bits, so a short malformed H.264 SPS can panic (debug builds), return a wrong value (release builds) or terminate the process.
pub fn read_exp_golomb_unsigned(&mut self) -> Result<u64, BitstreamError> {
let mut zeros = 0;
while self.read_bits(1)? == 0 && self.bits_left >= 0 {
zeros += 1;
}
let remaining_bits = self.read_bits(zeros)?;
let res = ((1u64 << zeros) - 1) + remaining_bits;
Ok(res)
}
- Exactly 64 leading zeros:
1u64 << 64overflows. Debug build:panicked at ... attempt to shift left with overflow. Release build: the shift count is masked, so the result is silently wrong (1u64 << 0). - More than 64 leading zeros:
read_bitsrejectsbnum > 64withfatal!, which exits the process.
Reachability
cc_bitstream.c forwards read_exp_golomb_unsigned() to this function, and seq_parameter_set_rbsp() in avc_functions.c calls it for seq_parameter_set_id. An SPS made of the 3-byte header followed by 8-9 zero bytes reaches it from do_NAL().
Reproduction
A lib_ccxr unit test that decodes 64 zero bits panics in a debug build. 9 zero bytes in an SPS makes the process exit through fatal!.
Expected
A BitstreamError that lets the caller skip the NAL.
Suggested fix
Return Err when zeros >= 64 (and have read_bits return Err instead of calling fatal! for bnum > 64). A related spot is slice_header(), which does 1 << log2_max_frame_num in C; H.264 only allows 4..16 there.
- Ngôn ngữ chính
- C
- Star
- 919
- Fork
- 604
- Merge trung bình
- 9 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 26
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CCExtractor/ccextractor
-
GXF: heap buffer overflow in parse_ad_cdp() — unbounded cc_count in CDP cc data sectionCó thể đã có người làm @pranayr710 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
CCExtractor/ccextractor#2498 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] + file-sequence expansion picks the digit in the extension (clip001.mp4+ only processes clip001.mp4)Có thể đã có người làm @imfarhan0105-bits đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
CCExtractor/ccextractor#2478 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] encoders: WebVTT encoder generates invalid ## delimiter and malformed @import violating W3C specificationCó thể đã có người làm @yasar710 đã nhận 7 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
CCExtractor/ccextractor#2465 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GXF: heap buffer overflow in parse_mpeg_packet() — oversized mpeg_pic_size overflows the demuxer bufferCó thể đã có người làm @pranayr710 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
CCExtractor/ccextractor#2500 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] DVB: map-table cases in dvbsub_parse_pixel_data_block read past the object field dataCó thể đã có người làm @pranayr710 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 30/100
CCExtractor/ccextractor#2482 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của CCExtractor/ccextractor
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
[TUTORIAL] Docs for Follow ModeĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: services kind: bug preview-effort: small priority: low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Static Analysis failureCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100