[BUG] `avc_ctx->cc_count` is `uint8_t`/`u8`, wrapping around when H.264 access units accumulate multiple SEIs beyond 255 triplets
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 62/100
Línea de trabajo
The counter is declared as unsigned char cc_count in src/lib_ccx/avc_functions.h and updated in copy_ccdata_to_buffer in src/lib_ccx/avc_functions.c, and the Rust mirror is the u8 field in src/rust/src/avc/common_types.rs. Start by reading copy_ccdata_to_buffer to see how cc_count indexes the buffer and what the MAX_CC_COUNT and HDCC_MAX_TRIPLETS_PER_SLOT limits assume. Done means the count type can hold 310 triplets on both sides, the two definitions agree, and the buffer bounds check still holds.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
CCExtractor version: master (post-#2359 / commit c1043ca7)
Necessary information
- Is this a regression (i.e. did it work before)? NO
- What platform did you use? All (Linux / macOS / Windows)
- What were the used arguments? Standard H.264 / MPEG-TS extraction (
ccextractor input.ts)
Summary
In commit c1043ca7 (#2359), MAX_CC_COUNT and HDCC_MAX_TRIPLETS_PER_SLOT were raised from 31 to 310 so that H.264 access units carrying multiple SEI messages can buffer all their caption triplets without discarding the frame.
However, avc_ctx->cc_count is typed as unsigned char in C (src/lib_ccx/avc_functions.h:6) and u8 in Rust (src/rust/src/avc/common_types.rs:7). Because an 8-bit unsigned integer caps out at 255, the buffer accumulator wraps around whenever an access unit carries dense or multiple SEI packets totaling between 256 and 310 triplets.
Root Cause Analysis
1. In C (src/lib_ccx/avc_functions.c:442-453):
struct avc_ctx
{
unsigned char cc_count; // <--- uint8_t: range 0..255
unsigned char *cc_data;
...
};
void copy_ccdata_to_buffer(struct avc_ctx *ctx, char *source, int new_cc_count)
{
...
memcpy(ctx->cc_data + ctx->cc_count * 3, source, new_cc_count * 3 + 1);
ctx->cc_count += new_cc_count; // <--- Wraps modulo 256 on overflow
ctx->cc_buffer_saved = CCX_FALSE;
}
- Lenguaje dominante
- C
- Estrellas
- 908
- Forks
- 595
- Merge medio
- 3 d 23 h
- PR fusionados (30 d)
- 32
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
-
[BUG] Filename sequence expansion (`+`) panics on numeric values exceeding `i32::MAX`Posiblemente ocupada @muntasir-396 la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
CCExtractor/ccextractor#2402 ·
Los mantenedores suelen responder en 1 día
-
CCExtractor: stack out-of-bounds write and quadratic out-of-bounds read in the DVB subtitle descriptor parser (parse_dvb_description)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
CCExtractor/ccextractor#2417 ·
Los mantenedores suelen responder en 1 día
-
[BUG] --out=report: heap-use-after-free in process608(), and a crash with more than one input filePosiblemente ocupada @Deepak-negi11 la tomó hace 2 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
CCExtractor/ccextractor#2412 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
CCExtractor/ccextractor#2408 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
CCExtractor/ccextractor#2398 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de CCExtractor/ccextractor
Issues similares
-
TLS: a stale OpenSSL error makes non-blocking reads fail with "Resource temporarily unavailable"Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
bigtreetech/BIGTREETECH-TouchScreenFirmware#3056 ·
Los mantenedores suelen responder en 1 día
-
Allow pillow 13Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
[pico][astrocade] emu/apply.sh edits src/mame/midway/astrohome.cpp, which current MAME has in bally/Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
FujiNetWIFI/fujinet-firmware#2120 ·
Los mantenedores suelen responder en 1 día