mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #2061] [CLOSED] [FIX] Guard against NULL timing context when reporting decoder statistics #2873
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/2061
Author: @hridyasadanand
Created: 1/24/2026
Status: ❌ Closed
Base:
master← Head:guard-null-timing-report📝 Commits (2)
9f344eeGuard against NULL timing context in decoder reporting6d2f58eRemove workflows to allow fork push📊 Changes
15 files changed (+3 additions, -1825 deletions)
View changed files
➖
.github/workflows/build_appimage.yml(+0 -157)➖
.github/workflows/build_deb.yml(+0 -283)➖
.github/workflows/build_deb_debian13.yml(+0 -275)➖
.github/workflows/build_docker.yml(+0 -96)➖
.github/workflows/build_linux.yml(+0 -117)➖
.github/workflows/build_linux_systemlibs.yml(+0 -154)➖
.github/workflows/build_mac.yml(+0 -177)➖
.github/workflows/build_windows.yml(+0 -142)➖
.github/workflows/format.yml(+0 -57)➖
.github/workflows/homebrew.yml(+0 -15)➖
.github/workflows/publish_chocolatey.yml(+0 -136)➖
.github/workflows/publish_winget.yml(+0 -38)➖
.github/workflows/release.yml(+0 -137)➖
.github/workflows/test_rust.yml(+0 -41)📝
src/ccextractor.c(+3 -0)📄 Description
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->timingin the decoder reporting loop at the end ofstart_ccx().Under certain execution paths, decoder contexts present in
ctx->dec_ctx_headmay not have an associated timing context. The current code unconditionally dereferencesdec_ctx->timing, which can lead to undefined behavior or crashes.This change safely skips such decoder entries during reporting.
Problem Description
The reporting loop in
start_ccx()assumes that every decoder inctx->dec_ctx_headhas a valid timing structure and unconditionally accesses timing fields.While decoders created via
init_cc_decode()always initialize timing, decoder contexts created viacopy_decoder_context()explicitly settiming = NULL. These copied decoder contexts may still be present indec_ctx_head.As a result,
dec_ctx->timingis not guaranteed to be non-NULL at this point.Fix
Add a simple guard before accessing timing fields: