Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions docs/CHANGES.TXT
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fix(general_loop): Add NULL checks for fopen() and alloc_demuxer_data() return values in process_hex()
0.96.7 (unreleased)
-------------------
- Fix: Prevent crash in Rust timing module when logging out-of-range PTS/FTS timestamps from malformed streams.
Expand Down
9 changes: 9 additions & 0 deletions src/lib_ccx/general_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,19 @@ void process_hex(struct lib_ccx_ctx *ctx, char *filename)
}
/* const char *mpeg_header="00 00 01 b2 43 43 01 f8 "; // Always present */
FILE *fr = fopen(filename, "rt");
if (!fr)
{
fatal(CCX_COMMON_EXIT_FILE_CREATION_FAILED, "In process_hex: Unable to open file %s for reading.", filename);
}
unsigned char *bytes = NULL;
unsigned byte_count = 0;
int warning_shown = 0;
struct demuxer_data *data = alloc_demuxer_data();
if (!data)
{
fclose(fr);
fatal(EXIT_NOT_ENOUGH_MEMORY, "In process_hex: Out of memory allocating demuxer data.");
}
while (fgets(line, max - 1, fr) != NULL)
{
char *c1, *c2 = NULL; // Positions for first and second colons
Expand Down
Loading