Skip to content

Commit 3dbe11b

Browse files
committed
fixed #2175
1 parent 1773b7a commit 3dbe11b

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Diff for: src/isomedia/box_code_3gpp.c

+4-12
Original file line numberDiff line numberDiff line change
@@ -1128,20 +1128,12 @@ void diST_box_del(GF_Box *s)
11281128

11291129
GF_Err diST_box_read(GF_Box *s, GF_BitStream *bs)
11301130
{
1131-
u32 i;
1132-
char str[1024];
11331131
GF_DIMSScriptTypesBox *p = (GF_DIMSScriptTypesBox *)s;
11341132

1135-
i=0;
1136-
str[0]=0;
1137-
while (1) {
1138-
str[i] = gf_bs_read_u8(bs);
1139-
if (!str[i]) break;
1140-
i++;
1141-
}
1142-
ISOM_DECREASE_SIZE(p, i);
1143-
1144-
p->content_script_types = gf_strdup(str);
1133+
p->content_script_types = gf_malloc(sizeof(char) * (s->size+1));
1134+
if (!p->content_script_types) return GF_OUT_OF_MEM;
1135+
gf_bs_read_data(bs, p->content_script_types, s->size);
1136+
p->content_script_types[s->size] = 0;
11451137
return GF_OK;
11461138
}
11471139

0 commit comments

Comments
 (0)