[PR #2025] [MERGED] fix(avc): prevent segfault in report-only mode (-out=report) #2827

Closed
opened 2026-01-29 17:24:06 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/2025
Author: @cfsmp3
Created: 1/17/2026
Status: Merged
Merged: 1/17/2026
Merged by: @cfsmp3

Base: masterHead: fix/avc-segfault-report-mode


📝 Commits (1)

  • fecd24d fix(avc): prevent segfault in report-only mode (-out=report)

📊 Changes

1 file changed (+13 additions, -0 deletions)

View changed files

📝 src/rust/src/avc/mod.rs (+13 -0)

📄 Description

Summary

  • Fixes segmentation fault when using -out=report on transport streams with AVC/H.264 or HEVC video
  • Adds NULL pointer checks at the Rust FFI boundary in ccxr_process_avc()

Root Cause

When using -out=report mode, the encoder context (enc_ctx) is intentionally NULL because no output file needs to be created. The Rust FFI function was dereferencing this NULL pointer without validation.

Test plan

  • Verified -out=report no longer segfaults on H.264 streams
  • Verified -out=report works on HEVC streams
  • Verified normal caption extraction still works

Fixes #2023

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/2025 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 1/17/2026 **Status:** ✅ Merged **Merged:** 1/17/2026 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/avc-segfault-report-mode` --- ### 📝 Commits (1) - [`fecd24d`](https://github.com/CCExtractor/ccextractor/commit/fecd24d08eab881dbe0de626ef5a635f5bbe0f4a) fix(avc): prevent segfault in report-only mode (-out=report) ### 📊 Changes **1 file changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/rust/src/avc/mod.rs` (+13 -0) </details> ### 📄 Description ## Summary - Fixes segmentation fault when using `-out=report` on transport streams with AVC/H.264 or HEVC video - Adds NULL pointer checks at the Rust FFI boundary in `ccxr_process_avc()` ## Root Cause When using `-out=report` mode, the encoder context (`enc_ctx`) is intentionally NULL because no output file needs to be created. The Rust FFI function was dereferencing this NULL pointer without validation. ## Test plan - [x] Verified `-out=report` no longer segfaults on H.264 streams - [x] Verified `-out=report` works on HEVC streams - [x] Verified normal caption extraction still works Fixes #2023 🤖 Generated with [Claude Code](https://claude.ai/code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:24:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2827