mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-15 05:26:07 +00:00
Teletext decoder: OOB read/write in remap_g0_charset on malformed input #889
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?
Originally created by @THE-Amrit-mahto-05 on GitHub (Jan 4, 2026).
description
While reviewing the Teletext decoder, I noticed that remap_g0_charset(uint8_t c) uses the c value as an index into G0_LATIN_NATIONAL_SUBSETS_MAP (size 56) without bounds checking.
The result of that lookup is then used as an index into another table (size 14), also without bounds validation.
Since c is a uint8_t, malformed input can trigger out-of-bounds reads/writes, leading to memory corruption of global tables.
I have a small defensive fix ready that adds bounds checks and early returns.