mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #2063] [FIX] Guard against NULL timing context when reporting decoder statistics #2874
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/2063
Author: @hridyasadanand
Created: 1/26/2026
Status: 🔄 Open
Base:
master← Head:guard-null-timing-report📝 Commits (3)
4e4cea5Guard against NULL timing context in decoder reportingf17a5e1format: apply clang-formata0e5a4eci: retrigger workflows📊 Changes
1 file changed (+3 additions, -0 deletions)
View changed files
📝
src/ccextractor.c(+3 -0)📄 Description
[FIX] Guard against NULL timing context when reporting decoder statistics
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Summary
This PR adds a defensive null check for dec_ctx->timing in the decoder reporting loop at the end of start_ccx().
Under certain execution paths, decoder contexts present in ctx->dec_ctx_head may not have an associated timing context. The current code assumes timing is always present and unconditionally dereferences dec_ctx->timing, which can lead to undefined behavior or crashes.
This change safely skips such decoder entries during reporting only.
Problem Description
The reporting loop in start_ccx() assumes that every decoder in ctx->dec_ctx_head has a valid timing structure.
While decoders created via init_cc_decode() always initialize timing, decoder contexts created via copy_decoder_context() explicitly set timing = NULL. These copied decoder contexts may still be present in dec_ctx_head, making the assumption invalid.
Fix
Add a simple guard before accessing timing fields: