Skip to content

Commit

Permalink
fixed #2133
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlf committed Mar 7, 2022
1 parent 89fca03 commit 6f37ae2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/isomedia/isom_read.c
Expand Up @@ -2721,13 +2721,23 @@ GF_Err gf_isom_get_user_data(GF_ISOFile *movie, u32 trackNumber, u32 UserDataTyp
ptr = (GF_UnknownBox*)gf_list_get(map->boxes, UserDataIndex-1);

if (ptr->type == GF_ISOM_BOX_TYPE_UNKNOWN) {
if (!ptr->dataSize) {
*userData = NULL;
*userDataSize = 0;
return GF_OK;
}
*userData = (char *)gf_malloc(sizeof(char)*ptr->dataSize);
if (!*userData) return GF_OUT_OF_MEM;
memcpy(*userData, ptr->data, sizeof(char)*ptr->dataSize);
*userDataSize = ptr->dataSize;
return GF_OK;
} else if (ptr->type == GF_ISOM_BOX_TYPE_UUID) {
GF_UnknownUUIDBox *p_uuid = (GF_UnknownUUIDBox *)ptr;
if (!p_uuid->dataSize) {
*userData = NULL;
*userDataSize = 0;
return GF_OK;
}
*userData = (char *)gf_malloc(sizeof(char)*p_uuid->dataSize);
if (!*userData) return GF_OUT_OF_MEM;
memcpy(*userData, p_uuid->data, sizeof(char)*p_uuid->dataSize);
Expand Down

0 comments on commit 6f37ae2

Please sign in to comment.