Skip to content

Commit a51f951

Browse files
committed
fixed #1782 (fuzz)
1 parent 1273cdc commit a51f951

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Diff for: applications/mp4box/main.c

+8
Original file line numberDiff line numberDiff line change
@@ -5439,6 +5439,14 @@ static u32 mp4box_cleanup(u32 ret_code) {
54395439
}
54405440
if (logfile) gf_fclose(logfile);
54415441
gf_sys_close();
5442+
5443+
#ifdef GPAC_MEMORY_TRACKING
5444+
if (mem_track && (gf_memory_size() || gf_file_handles_count() )) {
5445+
gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
5446+
gf_memory_print();
5447+
}
5448+
#endif
5449+
54425450
return ret_code;
54435451
}
54445452

Diff for: src/isomedia/box_code_adobe.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ GF_Err afra_box_read(GF_Box *s, GF_BitStream *bs)
408408
for (i=0; i<ptr->entry_count; i++) {
409409
GF_AfraEntry *ae = gf_malloc(sizeof(GF_AfraEntry));
410410
if (!ae) return GF_OUT_OF_MEM;
411+
gf_list_insert(ptr->local_access_entries, ae, i);
411412

412413
ISOM_DECREASE_SIZE(ptr, 8)
413414
ae->time = gf_bs_read_u64(bs);
@@ -418,8 +419,6 @@ GF_Err afra_box_read(GF_Box *s, GF_BitStream *bs)
418419
ISOM_DECREASE_SIZE(ptr, 4)
419420
ae->offset = gf_bs_read_u32(bs);
420421
}
421-
422-
gf_list_insert(ptr->local_access_entries, ae, i);
423422
}
424423

425424
if (ptr->global_entries) {
@@ -428,6 +427,8 @@ GF_Err afra_box_read(GF_Box *s, GF_BitStream *bs)
428427
for (i=0; i<ptr->global_entry_count; i++) {
429428
GF_GlobalAfraEntry *ae = gf_malloc(sizeof(GF_GlobalAfraEntry));
430429
if (!ae) return GF_OUT_OF_MEM;
430+
gf_list_insert(ptr->global_access_entries, ae, i);
431+
431432
ISOM_DECREASE_SIZE(ptr, 8)
432433
ae->time = gf_bs_read_u64(bs);
433434
if (ptr->long_ids) {
@@ -448,8 +449,6 @@ GF_Err afra_box_read(GF_Box *s, GF_BitStream *bs)
448449
ae->afra_offset = gf_bs_read_u32(bs);
449450
ae->offset_from_afra = gf_bs_read_u32(bs);
450451
}
451-
452-
gf_list_insert(ptr->global_access_entries, ae, i);
453452
}
454453
}
455454

0 commit comments

Comments
 (0)