Skip to content
Permalink
Browse files Browse the repository at this point in the history
fixed #1782 (fuzz)
  • Loading branch information
jeanlf committed May 10, 2021
1 parent 1273cdc commit a51f951
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 8 additions & 0 deletions applications/mp4box/main.c
Expand Up @@ -5439,6 +5439,14 @@ static u32 mp4box_cleanup(u32 ret_code) {
}
if (logfile) gf_fclose(logfile);
gf_sys_close();

#ifdef GPAC_MEMORY_TRACKING
if (mem_track && (gf_memory_size() || gf_file_handles_count() )) {
gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
gf_memory_print();
}
#endif

return ret_code;
}

Expand Down
7 changes: 3 additions & 4 deletions src/isomedia/box_code_adobe.c
Expand Up @@ -408,6 +408,7 @@ GF_Err afra_box_read(GF_Box *s, GF_BitStream *bs)
for (i=0; i<ptr->entry_count; i++) {
GF_AfraEntry *ae = gf_malloc(sizeof(GF_AfraEntry));
if (!ae) return GF_OUT_OF_MEM;
gf_list_insert(ptr->local_access_entries, ae, i);

ISOM_DECREASE_SIZE(ptr, 8)
ae->time = gf_bs_read_u64(bs);
Expand All @@ -418,8 +419,6 @@ GF_Err afra_box_read(GF_Box *s, GF_BitStream *bs)
ISOM_DECREASE_SIZE(ptr, 4)
ae->offset = gf_bs_read_u32(bs);
}

gf_list_insert(ptr->local_access_entries, ae, i);
}

if (ptr->global_entries) {
Expand All @@ -428,6 +427,8 @@ GF_Err afra_box_read(GF_Box *s, GF_BitStream *bs)
for (i=0; i<ptr->global_entry_count; i++) {
GF_GlobalAfraEntry *ae = gf_malloc(sizeof(GF_GlobalAfraEntry));
if (!ae) return GF_OUT_OF_MEM;
gf_list_insert(ptr->global_access_entries, ae, i);

ISOM_DECREASE_SIZE(ptr, 8)
ae->time = gf_bs_read_u64(bs);
if (ptr->long_ids) {
Expand All @@ -448,8 +449,6 @@ GF_Err afra_box_read(GF_Box *s, GF_BitStream *bs)
ae->afra_offset = gf_bs_read_u32(bs);
ae->offset_from_afra = gf_bs_read_u32(bs);
}

gf_list_insert(ptr->global_access_entries, ae, i);
}
}

Expand Down

0 comments on commit a51f951

Please sign in to comment.