mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-20 21:20:28 +00:00
[PR #2035] fix mkvlang_params_check: prevent panic on multi-byte characters #2842
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?
Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/2035
State: closed
Merged: Yes
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Description
The mkvlang_params_check function validates language codes in MKV files, but the previous implementation assumed 1 byte per character and used string indices derived from to_lowercase(). This caused panics when multi-byte characters (like ç) were used, because slicing by byte indices can go out-of-bounds.
Problem
Fix
Example after fix