fix(lib_ccx): add NULL checks for fopen and alloc_demuxer_data in process_hex (#2201)#2215
Conversation
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 03ad9e8...:
Your PR breaks these cases:
NOTE: The following tests have been failing on the master branch as well as the PR:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 03ad9e8...:
Your PR breaks these cases:
NOTE: The following tests have been failing on the master branch as well as the PR:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
cfsmp3
left a comment
There was a problem hiding this comment.
Thanks for the thorough work — this covers several files that genuinely need these checks. A few things to fix:
-
general_loop.c conflict: The
fopen()/alloc_demuxer_data()NULL checks inprocess_hex()were just merged via #2202. Please rebase to drop that file from your PR. -
Inconsistent error handling: In
ccx_encoders_helpers.cyou silentlyreturnon OOM, and inccx_common_common.cyoureturn -1. But inoutput.candccx_encoders_common.cyou callfatal(). Please usefatal(EXIT_NOT_ENOUGH_MEMORY, ...)consistently — if we're out of memory, silently skipping work will cause subtle bugs downstream. -
ts_functions.c: The
strdup("literal")→ string literal change is correct (no reason to heap-allocate constants), but note thatget_buffer_type_stris currently dead code (defined but never called, no header declaration). The change is fine to keep — just FYI. -
CHANGES.TXT: Not needed for internal-only fixes like these (no user-facing change). Please remove if present.
The ccx_encoders_common.c change (extracting strdup before passing to init_write) and the output.c check are both good. Just need the rebase and consistent fatal() calls.
This PR addresses Issue #2201 by adding missing NULL checks for fopen() and alloc_demuxer_data() return values in the process_hex() function in general_loop.c. This prevents potential null pointer dereferences if the input file cannot be opened or if memory allocation fails.