Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/CHANGES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
- Fix: Spurious numbers printed to console during processing
- Fix: Heap overflow in Transport Stream PAT/PMT parsing (security fix)
- Fix: Various memory safety and stability fixes in demuxers (MP4, PS, MKV, DVB)
- Fix: Configuration file parser bugs — heap buffer overflow on long lines, broken EOF
detection due to incorrect fgetc() return type, and last line dropped if file lacks
trailing newline
- Fix: Typos in configuration keys: FIX_PADDINDG → FIX_PADDING,
INVASTIGATE_PACKET → INVESTIGATE_PACKET

0.96.5 (2026-01-05)
-------------------
Expand Down
24 changes: 18 additions & 6 deletions src/lib_ccx/configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ struct conf_map configuration_map[] = {
{"OUTPUT_FORMAT", offsetof(struct ccx_s_options, write_format), set_int},
{"VIDEO_EDITED", offsetof(struct ccx_s_options, binary_concat), set_int},
{"GOP_TIME", offsetof(struct ccx_s_options, use_gop_as_pts), set_int},
{"FIX_PADDINDG", offsetof(struct ccx_s_options, fix_padding), set_int},
{"FIX_PADDING", offsetof(struct ccx_s_options, fix_padding), set_int},
{"GUI_MODE_REPORTS", offsetof(struct ccx_s_options, gui_mode_reports), set_int},
{"NO_PROGRESS_BAR", offsetof(struct ccx_s_options, no_progress_bar), set_int},
{"CAP_FILE", offsetof(struct ccx_s_options, sentence_cap_file), set_string},
{"PROFANITY_FILE", offsetof(struct ccx_s_options, filter_profanity_file), set_string},
{"START_AT", offsetof(struct ccx_s_options, extraction_start), set_time},
{"END_AT", offsetof(struct ccx_s_options, extraction_end), set_time},
{"INVASTIGATE_PACKET", offsetof(struct ccx_s_options, investigate_packets), set_int},
{"INVESTIGATE_PACKET", offsetof(struct ccx_s_options, investigate_packets), set_int},
{"FULL_BIN", offsetof(struct ccx_s_options, fullbin), set_int},
{"NO_SYNC", offsetof(struct ccx_s_options, nosync), set_int},
{"HAUPPAUGE_MODE", offsetof(struct ccx_s_options, hauppauge_mode), set_int},
Expand Down Expand Up @@ -91,12 +91,14 @@ static int parse_opts(char *str, struct ccx_s_options *opt)
static void parse_file(FILE *f, struct ccx_s_options *opt)
{
char *str = (char *)malloc(128);
char c = '\0';
if (!str)
return;
int c = '\0';
int comments = 0;
int i = 0;
int ret = 0;
*str = '\0';
while ((c = (char)fgetc(f)) != EOF)
while ((c = fgetc(f)) != EOF)
{
if (c == '\n')
{
Expand All @@ -116,8 +118,18 @@ static void parse_file(FILE *f, struct ccx_s_options *opt)
comments = 1;
continue;
}
str[i] = c;
i++;
if (i < 127)
{
str[i] = c;
str[i + 1] = '\0';
i++;
}
}
if (str[0] != '\0')
{
ret = parse_opts(str, opt);
if (ret < 0)
mprint("invalid configuration file\n");
}
free(str);
}
Expand Down
Loading