Skip to content

Conversation

@hridyasadanand
Copy link
Contributor

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

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 unconditionally dereferences dec_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 in ctx->dec_ctx_head has a valid timing structure and unconditionally accesses timing fields.

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.

As a result, dec_ctx->timing is not guaranteed to be non-NULL at this point.

Fix

Add a simple guard before accessing timing fields:

if (!dec_ctx->timing)
    continue;

@hridyasadanand hridyasadanand closed this by deleting the head repository Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant