Skip to content

Commit

Permalink
fixed potential crash - cf #1406
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlf committed Jun 11, 2020
1 parent e90526f commit 8e585e6
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/isomedia/box_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,11 @@ GF_Err gf_isom_box_parse_ex(GF_Box **outBox, GF_BitStream *bs, u32 parent_type,

newBox->size = size - hdr_size;

if (newBox->size) {
e = gf_isom_full_box_read(newBox, bs);
if (!e) e = gf_isom_box_read(newBox, bs);
newBox->size = size;
end = gf_bs_get_position(bs);
} else {
newBox->size = size;
//empty box
e = GF_OK;
end = gf_bs_get_position(bs);
}
//parse even if size is 0 - this makes sure that we perform box parsing (usually in box->read)
e = gf_isom_full_box_read(newBox, bs);
if (!e) e = gf_isom_box_read(newBox, bs);
newBox->size = size;
end = gf_bs_get_position(bs);

if (e && (e != GF_ISOM_INCOMPLETE_FILE)) {
gf_isom_box_del(newBox);
Expand Down

0 comments on commit 8e585e6

Please sign in to comment.