mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-17 19:43:50 +00:00
[PR #950] [FIX] Fix segfault in add_cc_sub_text and initialize to NULL in init_encoder #1780
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/950
State: closed
Merged: Yes
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):
My familiarity with the project is as follows (check one):
This commit adds some checks to avoid segmentation faults.
In
add_cc_sub_text(), strdup will cause a segfault if we duplicate anempty string.
In
init_encoder(), initialize pointer fields to NULL to avoid randomaddressing so we can avoid illegal memory accessing and segfaults in
other places.