We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b3bea4 commit 2af058eCopy full SHA for 2af058e
1 file changed
src/lib_ccx/general_loop.c
@@ -368,10 +368,21 @@ void process_hex(struct lib_ccx_ctx *ctx, char *filename)
368
}
369
/* const char *mpeg_header="00 00 01 b2 43 43 01 f8 "; // Always present */
370
FILE *fr = fopen(filename, "rt");
371
+ if (!fr)
372
+ {
373
+ free(line);
374
+ fatal(EXIT_FAILURE, "In process_hex: Cannot open %s.", filename);
375
+ }
376
unsigned char *bytes = NULL;
377
unsigned byte_count = 0;
378
int warning_shown = 0;
379
struct demuxer_data *data = alloc_demuxer_data();
380
+ if (!data)
381
382
+ fclose(fr);
383
384
+ fatal(EXIT_NOT_ENOUGH_MEMORY, "In process_hex: Out of memory allocating demuxer data.");
385
386
while (fgets(line, max - 1, fr) != NULL)
387
{
388
char *c1, *c2 = NULL; // Positions for first and second colons
0 commit comments