[PR #1992] [MERGED] fix: Teletext decoder panic on malformed BCD data #2793

Open
opened 2026-01-29 17:23:56 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1992
Author: @THE-Amrit-mahto-05
Created: 1/7/2026
Status: Merged
Merged: 1/18/2026
Merged by: @cfsmp3

Base: masterHead: fix/teletext-panic


📝 Commits (2)

  • 333cfb3 fix: Teletext decoder panic on malformed BCD data (#1990)
  • 10ac5ca add safety checks and comments in Teletext decoder

📊 Changes

1 file changed (+60 additions, -54 deletions)

View changed files

📝 src/rust/lib_ccxr/src/teletext.rs (+60 -54)

📄 Description

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.

Description

This PR fixes a crash in the Teletext decoder caused by unwrap() on malformed BCD data.

Although PR #1991 addressed a related issue in the Rust word file parser for #1990, some edge cases in the Teletext decoder were left unhandled. This PR fixes those remaining cases.

Changes made

  • Replaced all unwrap() calls in teletext.rs with safe alternatives (unwrap_or(0) or early return) to prevent panics.
  • Ensures malformed broadcast packets no longer crash.

Context

  • A previous PR (#1991) fixed a similar issue in the Rust word file parser, preventing panics from malformed input.
  • However, some edge cases in the Teletext decoder were not addressed at that time. This PR safely handles those remaining cases.

Fixes #1990

Verification

  • Unit tests simulate malformed BCD input and confirm no panics.
  • Verified CCExtractor runs normally under invalid Teletext packets.

🔄 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/1992 **Author:** [@THE-Amrit-mahto-05](https://github.com/THE-Amrit-mahto-05) **Created:** 1/7/2026 **Status:** ✅ Merged **Merged:** 1/18/2026 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/teletext-panic` --- ### 📝 Commits (2) - [`333cfb3`](https://github.com/CCExtractor/ccextractor/commit/333cfb37268fc7cf5b927c3c627be8ec59a19701) fix: Teletext decoder panic on malformed BCD data (#1990) - [`10ac5ca`](https://github.com/CCExtractor/ccextractor/commit/10ac5ca6cec8a69297416637977ba59060ebd997) add safety checks and comments in Teletext decoder ### 📊 Changes **1 file changed** (+60 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `src/rust/lib_ccxr/src/teletext.rs` (+60 -54) </details> ### 📄 Description <!-- Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**. --> **In raising this pull request, I confirm the following (please check boxes):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that another pull request for this purpose does not exist. - [x] I have considered, and confirmed that this submission will be valuable to others. - [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [x] I give this submission freely, and claim no ownership to its content. - [x] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **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. - [x] I am an active contributor to CCExtractor. --- ### Description This PR fixes a crash in the Teletext decoder caused by unwrap() on malformed BCD data. Although PR #1991 addressed a related issue in the Rust word file parser for #1990, some edge cases in the Teletext decoder were left unhandled. This PR fixes those remaining cases. ### Changes made - Replaced all unwrap() calls in teletext.rs with safe alternatives (unwrap_or(0) or early return) to prevent panics. - Ensures malformed broadcast packets no longer crash. ### Context - A previous PR (#1991) fixed a similar issue in the Rust word file parser, preventing panics from malformed input. - However, some edge cases in the Teletext decoder were not addressed at that time. This PR safely handles those remaining cases. Fixes #1990 ### Verification - Unit tests simulate malformed BCD input and confirm no panics. - Verified CCExtractor runs normally under invalid Teletext packets. --- <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:23:56 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2793