Commit Graph

369 Commits

Author SHA1 Message Date
Carlos Fernandez Sanz
749b355855 fix(scc): no base char before special chars, and fix OOB control code at column 0 (#2309)
Two defects in the SCC/CCD writer.

1. Special characters gained a spurious leading space.

#2301 emits a fallback base character before every internal code >= 0x80, but
only EXTENDED characters (0x90-0xcf, hi 0x12/0x13) backspace-replace the cell
before them -- handle_extended() decrements cursor_column. SPECIAL characters
(0x80-0x8f, hi 0x11) are stand-alone: handle_double() writes them without
moving the cursor back, so the base character stays on screen and every one of
them came back one column to the right on re-decode.

Only emit the base character for extended codes. check_padding() still runs for
both so the two-byte code starts on an even offset and lands inside a single
SCC word.

Verified with an SCC exercising all 80 codes in 0x80-0xcf, re-encoded and
decoded again: 79/80 wrong before #2301, 16/80 after it, 0/80 now. On real
samples, 725a49f871 (15 music-note rows) and c032183ef0 (3) round-trip with no
altered text; the apostrophe from #2098 is unchanged at "a7 80 92 29".

2. Out-of-bounds control code index when a style change starts at column 0.

get_preamble_code() and get_tab_offset_code() take unsigned char, so the
column - 1 used to place the preamble one cell left wrapped to 255 at column 0,
yielding 255 / 4 = 63 and an index far past the end of control_codes[]. Row 12
produced code 186 against CONTROL_CODE_MAX 147.

In --out=ccd that garbage entry is passed to strlen() and segfaults; in
--out=scc it silently emits whatever ints follow the array. The read has been
there since before #2301 -- 2 of 20 local samples hit it -- but the layout
change from #2301 moved the garbage pointer into unmapped memory, so it now
crashes rather than misbehaving quietly.

Clamp the preamble column to 0, matching what the adjacent space branch already
does.

Non-SCC output (txt, sami, srt, ttxt, webvtt, g608) is byte-identical to master
across 20 samples. Of those 20, SCC output changes on 12 with special
characters and on 1 that hit the out-of-bounds index; the other 7 are
unchanged. Valgrind reports no invalid reads, only the pre-existing 32-byte
init_encoder leak that master has too.
2026-08-09 16:55:14 -07:00
Bo Bayles
9f78685f42 Fix typo: hat was -> that was (#2295) 2026-07-26 11:08:52 -07:00
Dhanush
10d9230836 Fix/cea 708 c1 bounds check (#2258)
* fix: move C0 bounds check before match, improve C1 warn message

- C0 handler: bounds check was after the match, meaning process_p16(&block[1..])
  could panic with an index out of bounds before the guard ran. Moved the check
  before the match to prevent this.
- C1 handler: improved the warn message to include command code, name, and
  lengths for easier debugging.

Fixes #1407

* docs: update CHANGES.TXT for #1407 fix

* style: cargo fmt

---------

Co-authored-by: Dhanush Varma <your@email.com>
2026-04-18 11:58:10 -07:00
ujjwalr27
ad4886e719 feat: auto-extract multi-language DVB subtitles into per-language files (#447) (#2243)
* feat: auto-extract multi-language DVB subtitles into per-language files

* style: apply clang-format to multi-DVB subtitle extraction changes

* fix: only add lang suffix when 2+ DVB PID

* fix segfault from uninitialized dvb_lang

* docs: add CHANGES.TXT entry for multi-language DVB subtitle extraction

* fix: skip non-DVB encoders in lookup
2026-04-10 22:53:16 -07:00
pszemus
03ad9e8e02 [FEATURE] Allow output \0 terminated frames (for WebSocket streaming support) (#2105)
* [feat] Allow output \0 terminated frames

* Fix rust `FromCType`

* use encoded_end_frame for text-based captions

* add changelog entry

* fix CEA-708 Rust decoder

* fix Rust formating

* remove unused `crlf` field - satisfy clippy function argument limit

* silence clippy function argument limit in `Writer`

* Fix writing frame end with multiline captions

* fix formatting errors
2026-03-18 18:16:43 -07:00
Atul Chahar
9f250b144d fix(cea708): use dynamic current_fps instead of hardcoded 29.97 in SCC frame delays (#2173)
Replace all 6 hardcoded 1000/29.97 frame delay calculations in
dtvcc_write_scc() with 1000/current_fps so that CEA-708 SCC output
uses the actual stream framerate instead of assuming NTSC 29.97.

Fixes #2172
2026-03-17 20:20:17 -07:00
Chandragupt Singh
ed7f544e10 [FEATURE] Add guarded ASS/SSA \pos positioning for CEA-608 captions (#1885)
* feat(ssa): add guarded ASS \pos positioning for CEA-608 captions

* fix(ssa): correct ASS positioning anchor, validate row adjacency, and clean up variable placement

* fix(ssa): adjust top margin to prevent clipping of top-positioned CEA-608 captions

* ssa: map CEA-608 row+col to ASS coords using FFmpeg safe-area formula and fix \an2→\an7 anchor
2026-03-14 10:13:40 -07:00
Atul Chahar
58a8ded621 Fix MSVC cross-CRT invalid free on output_filename (#2147) 2026-03-12 18:54:47 -07:00
Carlos Fernandez Sanz
ee57fb46f3 chore: clean up #2168 merge — drop internal CHANGES.TXT entry, fix whitespace (#2196)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-12 18:49:44 -07:00
Varad Raj Agrawal
dc1d8d9592 fix: move VBI_DEBUG to CMake opt-in, fix MSVC empty struct error (#2168)
- Remove unconditional #define VBI_DEBUG from ccx_decoders_vbi.h
- Add CMake option VBI_DEBUG (OFF by default) in src/CMakeLists.txt
- Use #ifdef VBI_DEBUG / #else for debug_file_name vs reserved member,
  preventing MSVC C2016 empty struct error in non-debug builds
- Add changelog entry in docs/CHANGES.TXT under 0.96.7 unreleased

Fixes #2167
2026-03-12 18:47:43 -07:00
Varad Raj Agrawal
90128d8c28 fix: memory leaks and invalid CSS in WebVTT encoder (#2164)
* fix: memory leaks and invalid CSS in WebVTT encoder

- Remove 6 unnecessary strdup() calls on string literals in
  write_cc_buffer_as_webvtt() — literals are passed directly to
  write_wrapped() which takes void*, no heap allocation needed.
  This runs in a per-character inner loop and leaked on every
  styled subtitle in a broadcast.
- Fix invalid CSS: rgba(0, 256, 0, 0.5) -> rgba(0, 255, 0, 0.5)
  CSS color channels are 0-255; 256 is out of range.
- Fix missing free(unescaped) on write-error path in
  write_stringz_as_webvtt() — matched the existing pattern on
  the adjacent error path which correctly freed both el and unescaped.

Fixes #2154

* fix: move WebVTT changelog entry to unreleased 0.96.7 section
2026-03-07 00:37:12 -08:00
Carlos Fernandez
36711b9d3b Merge origin/master into fix/x86-decoder-alloc-panic
Resolve CHANGES.TXT conflict: keep both entries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 13:07:54 -08:00
Carlos Fernandez Sanz
c919dafd4a Merge pull request #2150 from Varadraj75/fix/scc-framerate-help-and-23.98-alias
[FEATURE] :  Add 23.98fps alias for --scc-framerate and clarify help text
2026-02-28 12:59:17 -08:00
Carlos Fernandez Sanz
f457348a43 Merge pull request #2138 from x15sr71/fix/rust-timing-unwrap-panic
FIX(rust): prevent panic when formatting out-of-range timestamps in timing.rs and c_functions.rs
2026-02-28 10:30:05 -08:00
Chandragupt Singh
7047583cdf Merge branch 'master' into fix/x86-decoder-alloc-panic 2026-02-28 17:52:49 +05:30
Chandragupt Singh
3af7a6a336 chore: add changelog entry and update test comment for lazy allocation 2026-02-28 17:38:38 +05:30
Varadraj75
f7bdb86504 feat: add 23.98fps as valid --scc-framerate value and fix help text
- Add case 4 (23.976f) to both get_scc_fps() and get_scc_fps_internal()
  in ccx_encoders_scc.c so --scc-framerate 23.98 produces correct output
- Add "23.98" | "23.976" match arm in parser.rs mapping to value 4
- Add test_scc_framerate_23_98() unit test in parser.rs
- Update --scc-framerate help text to clarify it affects both input
  parsing AND output encoding (not input only)
- Add 23.98 to the listed valid values in the help text

Follows up on discussion in #2145 and #2146.
2026-02-28 16:58:58 +05:30
Carlos Fernandez Sanz
733ed89feb Merge pull request #2134 from x15sr71/fix/spupng-indexing-and-path
[Fix]: SPUPNG indexing, EOD counter advance, and header path determinism
2026-02-25 14:19:30 -08:00
Chandragupt Singh
10c612f90c docs: add changelog entry 2026-02-24 02:31:16 +05:30
Apoorv Darshan
3865385763 Fix configuration file parsing bugs and typos
Fix multiple bugs in parse_file(): heap buffer overflow on long lines
(no bounds check on 128-byte buffer), broken EOF detection (fgetc()
return stored in char instead of int), missing NULL check after malloc,
missing null-terminator on accumulated string, and last line silently
dropped if file lacks trailing newline.

Also fix typos in configuration_map[]: FIX_PADDINDG → FIX_PADDING,
INVASTIGATE_PACKET → INVESTIGATE_PACKET.
2026-02-23 00:14:31 +05:30
Chandragupt Singh
3857a5756f docs: add changelog entry 2026-02-22 22:58:37 +05:30
Carlos Fernandez
eb7580498e Update CHANGES.TXT for 0.96.6 release
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:07:58 -08:00
Carlos Fernandez
7bd3be1cd1 Merge master into feat/json-report, resolve CHANGES.TXT conflict
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 14:02:37 -08:00
Carlos Fernandez Sanz
0a4916f871 Merge pull request #2104 from AhmedAlian7/feat/transcript-dictionary-support
feat(transcript): Implement dictionary-based capitalization and censorship
2026-02-15 10:45:49 -08:00
Carlos Fernandez
45afa8a429 Merge origin/master into pr-2110 (resolve CHANGES.TXT conflict) 2026-02-15 08:56:20 -08:00
ishaan-arora-1
1afd909e8a fix(matroska): add missing open() check and close() in save_sub_track
save_sub_track() was missing two things:

1. No check on the return value of open(). If open() failed,
   desc would be -1, and the subsequent write_wrapped() calls
   would trigger a fatal error with a confusing message.

2. The file descriptor was never closed at the end of the function,
   leaking it on every call. The neighboring save_vobsub_track()
   already handles both correctly — this brings save_sub_track()
   in line with it.
2026-02-14 05:42:55 +05:30
ishaan-arora-1
9710e8163c fix(matroska): use correct strlen for end timestamp in subtitle output
In save_sub_track(), the length argument for writing timestamp_end
was incorrectly using strlen(timestamp_start) instead of
strlen(timestamp_end). This affected WebVTT, SRT, and ASS/SSA
output paths for Matroska subtitle extraction.
2026-02-14 05:35:41 +05:30
Ahmed Alian
2ac017f8fe feat(transcript): Implement dictionary-based capitalization and censorship 2026-02-09 20:03:10 +02:00
Chandragupt Singh
eafc3904c5 Merge branch 'master' into feat/json-report 2026-02-08 23:29:24 +05:30
Carlos Fernandez Sanz
10288243b9 Merge pull request #2100 from x15sr71/fix/dvb-eit-bcd-start-time
[FIX]: Properly decode DVB EIT start time BCD field in XMLTV output
2026-02-07 13:25:03 -08:00
Chandragupt Singh
f920c16a53 docs: add changelog entry 2026-02-08 00:59:18 +05:30
Nicolas Dato
2582f628dd Fix sigsegv (#2090)
* Fix SIGSEGV when using --multiprogram

* Update CHANGES.TXT
2026-02-07 10:24:51 -08:00
Chandragupt Singh
556392a9fe docs(changelog): mention JSON output support for -out=report 2026-02-04 00:28:03 +05:30
Chandragupt Singh
05c68349d5 Merge branch 'master' into feat/snap-distribution-support 2026-01-23 15:26:59 +05:30
Chandragupt Singh
09f21f64e4 fix(snap): resolve GPAC dependency and runtime issues in core22 snap 2026-01-23 15:23:33 +05:30
Carlos Fernandez
91d3512bcc fix(rust): Support BCP 47 language tags in --mkvlang option
The --mkvlang option previously only supported single ISO 639-2 codes
due to using a Language enum with a fixed list of variants. Extended
codes (like "fre-ca") and multiple codes (like "eng,chi") would panic.

This change introduces MkvLangFilter, a proper type for language
filtering that:

- Validates language codes per BCP 47 specification
- Supports ISO 639-2 (3-letter codes like "eng")
- Supports BCP 47 tags (like "en-US", "zh-Hans-CN")
- Supports comma-separated multiple codes
- Provides clean error messages for invalid input
- Includes comprehensive unit tests

The C code continues to receive the raw string for strstr() matching,
maintaining backward compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 13:23:39 -08:00
collectnis
7159d0b6d0 fix: resolve merge conflict in changelog 2026-01-11 11:48:58 +00:00
collectnis
c515578e37 docs: update changelog 2026-01-11 11:30:54 +00:00
Carlos Fernandez
13f1b5ab53 docs: Add changelog for 0.96.6
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 10:28:56 +01:00
Carlos Fernandez Sanz
d999c3e0e0 Merge pull request #1985 from x15sr71/docs/homebrew-install
docs: Add Homebrew installation instructions to COMPILATION.MD
2026-01-10 23:43:42 +01:00
Chandragupt
493495361d ci(snap): use stable GitHub Actions v6 and make runtime library resolution robust 2026-01-08 09:24:25 +05:30
Chandragupt
643857e98f docs: add changelog entry for Snap packaging 2026-01-08 06:09:33 +05:30
GAURAV KARMAKAR
c609f66c02 Removed Build Artifact 2026-01-08 01:03:54 +05:30
Chandragupt Singh
401ff6c105 docs: note Homebrew availability in changelog 2026-01-06 06:04:57 +05:30
Chandragupt Singh
83eb51ed6f docs: add Homebrew installation instructions 2026-01-06 06:01:56 +05:30
Carlos Fernandez
4a4911bcec chore: Bump version to 0.96.5
Update version number across all packaging and build files for the
0.96.5 release.

Files updated:
- docs/CHANGES.TXT - Added changelog entry
- src/lib_ccx/lib_ccx.h - VERSION define
- linux/configure.ac - AC_INIT version
- mac/configure.ac - AC_INIT version
- OpenBSD/Makefile - V variable
- package_creators/PKGBUILD - pkgver
- package_creators/ccextractor.spec - Version
- package_creators/debian.sh - VERSION
- packaging/chocolatey/ccextractor.nuspec - version
- packaging/chocolatey/tools/chocolateyInstall.ps1 - URL
- packaging/winget/*.yaml - PackageVersion and URLs

Note: SHA256 checksums in chocolatey and winget files will need to be
updated after the MSI is built.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 12:44:06 +01:00
Kurma Ritish
0890e06d84 docs: add Windows WSL build instructions 2026-01-04 08:47:48 +00:00
Amrit Kumar Mahto
774c3a0d3a Update CHANGES.TXT 2026-01-02 04:31:39 +05:30
Carlos Fernandez Sanz
a2d2c4f063 Merge branch 'master' into release/0.96.4 2026-01-01 10:39:12 +01:00
Carlos Fernandez
4ab6c83c27 chore: Bump version to 0.96.4
Update version numbers across all packaging and build files for the
0.96.4 release.

Changes in 0.96.4:
- New: Persistent CEA-708 decoder context
- New: OCR character blacklist options
- New: OCR line-split option
- Fix: 32-bit build failures (i686, armv7l)
- Fix: Legacy argument compatibility (-1, -2, -12, --sc, --svc)
- Fix: Prevent heap buffer overflow in Teletext (security)
- Fix: Lazy OCR initialization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 10:17:56 +01:00