[BUG] read_exp_golomb_unsigned panics/aborts on 64 or more leading zero bits (malformed SPS)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C
- Estrellas
- 919
- Forks
- 604
- Merge medio
- 9 d 5 h
- PR fusionados (30 d)
- 26
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CCExtractor/ccextractor
-
GXF: heap buffer overflow in parse_ad_cdp() — unbounded cc_count in CDP cc data sectionPosiblemente ocupada @pranayr710 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
CCExtractor/ccextractor#2498 ·
Los mantenedores suelen responder en 1 día
-
[BUG] + file-sequence expansion picks the digit in the extension (clip001.mp4+ only processes clip001.mp4)Posiblemente ocupada @imfarhan0105-bits la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
CCExtractor/ccextractor#2478 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG] encoders: WebVTT encoder generates invalid ## delimiter and malformed @import violating W3C specificationPosiblemente ocupada @yasar710 la tomó hace 7 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
CCExtractor/ccextractor#2465 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
GXF: heap buffer overflow in parse_mpeg_packet() — oversized mpeg_pic_size overflows the demuxer bufferPosiblemente ocupada @pranayr710 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
CCExtractor/ccextractor#2500 ·
Los mantenedores suelen responder en 1 día
-
[BUG] DVB: map-table cases in dvbsub_parse_pixel_data_block read past the object field dataPosiblemente ocupada @pranayr710 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 30/100
CCExtractor/ccextractor#2482 ·
Los mantenedores suelen responder en 1 día
Todos los issues de CCExtractor/ccextractor
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
[TUTORIAL] Docs for Follow ModeAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
area: services kind: bug preview-effort: small priority: low
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Static Analysis failurePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100