## Description
There is a heap buffer overflow detected by AddressSanitizer

## System info
```
Ubuntu 20.04.2 LTS
clang version 12.0.0-++20210402082642+04ba60cfe598-1~exp1~20210402063359.71
MP4Box - GPAC version 1.1.0-DEV-rev1745-g9e1378706-master
```

## Build command
```
./configure --static-mp4box --prefix=`realpath ./install` --enable-sanitizer --cc=clang --cxx=clang++
```

## crash command
```
MP4Box -frag 0 -out /dev/null poc_file
```

## Pocs

[poc.zip](https://github.com/gpac/gpac/files/8039023/poc.zip)


## Crash output

```
==26783==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000019f1 at pc 0x000000430bd6 bp 0x7ffd20148550 sp 0x7ffd20147d10
READ of size 2 at 0x6020000019f1 thread T0
    #0 0x430bd5 in strlen (/programs/mp4box/builds/build13/bin/gcc/MP4Box+0x430bd5)
    #1 0xd933ac in mp4_mux_set_udta /programs/mp4box/builds/build13/src/filters/mux_isom.c:756:18
    #2 0xd933ac in mp4_mux_setup_pid /programs/mp4box/builds/build13/src/filters/mux_isom.c:3342:3
    #3 0xb16b42 in gf_filter_pid_configure /programs/mp4box/builds/build13/src/filter_core/filter_pid.c:752:6
    #4 0xb2b9c6 in gf_filter_pid_connect_task /programs/mp4box/builds/build13/src/filter_core/filter_pid.c:1061:3
    #5 0xb5ef3e in gf_fs_thread_proc /programs/mp4box/builds/build13/src/filter_core/filter_session.c:1799:3
    #6 0xb5dde4 in gf_fs_run /programs/mp4box/builds/build13/src/filter_core/filter_session.c:2043:2
    #7 0x911280 in gf_media_fragment_file /programs/mp4box/builds/build13/src/media_tools/isom_tools.c:3821:6
    #8 0x4e6fcc in mp4boxMain /programs/mp4box/builds/build13/applications/mp4box/main.c:6455:7
    #9 0x7f166462d0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #10 0x41ea6d in _start (/programs/mp4box/builds/build13/bin/gcc/MP4Box+0x41ea6d)

0x6020000019f1 is located 0 bytes to the right of 1-byte region [0x6020000019f0,0x6020000019f1)
allocated by thread T0 here:
    #0 0x499ccd in malloc (/programs/mp4box/builds/build13/bin/gcc/MP4Box+0x499ccd)
    #1 0x7e0750 in gf_isom_get_user_data /programs/mp4box/builds/build13/src/isomedia/isom_read.c:2724:24
    #2 0x1577520 in isor_declare_track /programs/mp4box/builds/build13/src/filters/isoffin_load.c:889:7
    #3 0x1580b67 in isor_declare_objects /programs/mp4box/builds/build13/src/filters/isoffin_load.c:1453:3
    #4 0xd0347d in isoffin_initialize /programs/mp4box/builds/build13/src/filters/isoffin_read.c:485:8
    #5 0xb730a3 in gf_filter_new_finalize /programs/mp4box/builds/build13/src/filter_core/filter.c:431:8
    #6 0xb7186c in gf_filter_new /programs/mp4box/builds/build13/src/filter_core/filter.c:385:7
    #7 0xb5d4fb in gf_fs_load_filter_internal /programs/mp4box/builds/build13/src/filter_core/filter_session.c:1293:13
    #8 0x9111c8 in gf_media_fragment_file /programs/mp4box/builds/build13/src/media_tools/isom_tools.c:3789:6
    #9 0x4e6fcc in mp4boxMain /programs/mp4box/builds/build13/applications/mp4box/main.c:6455:7
    #10 0x7f166462d0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/programs/mp4box/builds/build13/bin/gcc/MP4Box+0x430bd5) in strlen
Shadow bytes around the buggy address:
  0x0c047fff82e0: fa fa 00 00 fa fa 00 00 fa fa 07 fa fa fa 00 00
  0x0c047fff82f0: fa fa 00 00 fa fa 04 fa fa fa 00 00 fa fa fd fd
  0x0c047fff8300: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
  0x0c047fff8310: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 05 fa
  0x0c047fff8320: fa fa 00 00 fa fa 00 00 fa fa 00 fa fa fa fd fd
=>0x0c047fff8330: fa fa fd fd fa fa 00 03 fa fa 00 02 fa fa[01]fa
  0x0c047fff8340: fa fa 00 02 fa fa 00 00 fa fa 00 00 fa fa 00 00
  0x0c047fff8350: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00
  0x0c047fff8360: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00
  0x0c047fff8370: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00
  0x0c047fff8380: fa fa 00 01 fa fa 02 fa fa fa 00 00 fa fa 06 fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==26783==ABORTING
```
There is a heap buffer overflow detected by AddressSanitizer
This is a GitHub Issue
repo:gpac
owner:gpac
Title : There is a heap buffer overflow detected by AddressSanitizer
Issue date:

--- start body ---
## Description
There is a heap buffer overflow detected by AddressSanitizer

## System info
```
Ubuntu 20.04.2 LTS
clang version 12.0.0-++20210402082642+04ba60cfe598-1~exp1~20210402063359.71
MP4Box - GPAC version 1.1.0-DEV-rev1745-g9e1378706-master
```

## Build command
```
./configure --static-mp4box --prefix=`realpath ./install` --enable-sanitizer --cc=clang --cxx=clang++
```

## crash command
```
MP4Box -frag 0 -out /dev/null poc_file
```

## Pocs

[poc.zip](https://github.com/gpac/gpac/files/8039023/poc.zip)


## Crash output

```
==26783==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000019f1 at pc 0x000000430bd6 bp 0x7ffd20148550 sp 0x7ffd20147d10
READ of size 2 at 0x6020000019f1 thread T0
    #0 0x430bd5 in strlen (/programs/mp4box/builds/build13/bin/gcc/MP4Box+0x430bd5)
    #1 0xd933ac in mp4_mux_set_udta /programs/mp4box/builds/build13/src/filters/mux_isom.c:756:18
    #2 0xd933ac in mp4_mux_setup_pid /programs/mp4box/builds/build13/src/filters/mux_isom.c:3342:3
    #3 0xb16b42 in gf_filter_pid_configure /programs/mp4box/builds/build13/src/filter_core/filter_pid.c:752:6
    #4 0xb2b9c6 in gf_filter_pid_connect_task /programs/mp4box/builds/build13/src/filter_core/filter_pid.c:1061:3
    #5 0xb5ef3e in gf_fs_thread_proc /programs/mp4box/builds/build13/src/filter_core/filter_session.c:1799:3
    #6 0xb5dde4 in gf_fs_run /programs/mp4box/builds/build13/src/filter_core/filter_session.c:2043:2
    #7 0x911280 in gf_media_fragment_file /programs/mp4box/builds/build13/src/media_tools/isom_tools.c:3821:6
    #8 0x4e6fcc in mp4boxMain /programs/mp4box/builds/build13/applications/mp4box/main.c:6455:7
    #9 0x7f166462d0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #10 0x41ea6d in _start (/programs/mp4box/builds/build13/bin/gcc/MP4Box+0x41ea6d)

0x6020000019f1 is located 0 bytes to the right of 1-byte region [0x6020000019f0,0x6020000019f1)
allocated by thread T0 here:
    #0 0x499ccd in malloc (/programs/mp4box/builds/build13/bin/gcc/MP4Box+0x499ccd)
    #1 0x7e0750 in gf_isom_get_user_data /programs/mp4box/builds/build13/src/isomedia/isom_read.c:2724:24
    #2 0x1577520 in isor_declare_track /programs/mp4box/builds/build13/src/filters/isoffin_load.c:889:7
    #3 0x1580b67 in isor_declare_objects /programs/mp4box/builds/build13/src/filters/isoffin_load.c:1453:3
    #4 0xd0347d in isoffin_initialize /programs/mp4box/builds/build13/src/filters/isoffin_read.c:485:8
    #5 0xb730a3 in gf_filter_new_finalize /programs/mp4box/builds/build13/src/filter_core/filter.c:431:8
    #6 0xb7186c in gf_filter_new /programs/mp4box/builds/build13/src/filter_core/filter.c:385:7
    #7 0xb5d4fb in gf_fs_load_filter_internal /programs/mp4box/builds/build13/src/filter_core/filter_session.c:1293:13
    #8 0x9111c8 in gf_media_fragment_file /programs/mp4box/builds/build13/src/media_tools/isom_tools.c:3789:6
    #9 0x4e6fcc in mp4boxMain /programs/mp4box/builds/build13/applications/mp4box/main.c:6455:7
    #10 0x7f166462d0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/programs/mp4box/builds/build13/bin/gcc/MP4Box+0x430bd5) in strlen
Shadow bytes around the buggy address:
  0x0c047fff82e0: fa fa 00 00 fa fa 00 00 fa fa 07 fa fa fa 00 00
  0x0c047fff82f0: fa fa 00 00 fa fa 04 fa fa fa 00 00 fa fa fd fd
  0x0c047fff8300: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
  0x0c047fff8310: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 05 fa
  0x0c047fff8320: fa fa 00 00 fa fa 00 00 fa fa 00 fa fa fa fd fd
=>0x0c047fff8330: fa fa fd fd fa fa 00 03 fa fa 00 02 fa fa[01]fa
  0x0c047fff8340: fa fa 00 02 fa fa 00 00 fa fa 00 00 fa fa 00 00
  0x0c047fff8350: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00
  0x0c047fff8360: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00
  0x0c047fff8370: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00
  0x0c047fff8380: fa fa 00 01 fa fa 02 fa fa fa 00 00 fa fa 06 fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==26783==ABORTING
```
--- end body ---
