Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tidy: Fix rare null pointer dereference in cc707decoder.cpp.
The clang-tidy "non-null parameter checker" pointed out to possibility of the cc708 decoder dereferencing through a null pointer. This code starts with a default buffer size of 512 and then attempts to allocate a larger buffer when necessary (in this case, if a single subtitle is more than 512 characters.) If the reallocation fails, the code would end up storing the nullptr error return into the buffer pointer, and then dereference it an an attempt to store the new characters. Catch this rare condition and drop the characters that won't fit into the existing buffer. Fixes #13436. (cherry picked from commit d0356ab)
- Loading branch information
1 parent
ff932db
commit 74992bb
Showing
1 changed file
with
27 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters