## 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-rev1663-g881c6a94a-master
```

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

## Crash command
MP4Box -isma -timescale 600 -out /dev/null poc_file

## Pocs
[poc.zip](https://github.com/gpac/gpac/files/7938896/poc.zip)

## Output
poc_21
```
------------------------
[iso file] Unknown top-level box type ip4p
[iso file] Unknown top-level box type 00010000
[iso file] Box "afrt" size 750 (start 193) invalid (read 984)
Converting to ISMA Audio-Video MP4 file
0.500 secs Interleaving
=================================================================
==30134==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000001052 at pc 0x000000430bd6 bp 0x7fffa7327d30 sp 0x7fffa73274f0
READ of size 3 at 0x602000001052 thread T0
    #0 0x430bd5 in strlen (/zhengjie/cmdline-fuzz/programs/mp4box/build2/bin/gcc/MP4Box+0x430bd5)
    #1 0xa593e8 in afrt_box_size /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_code_adobe.c:764:14
    #2 0x8da456 in gf_isom_box_size_listing /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_funcs.c:1913:9
    #3 0x8da456 in gf_isom_box_size /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_funcs.c:1925:6
    #4 0x945413 in WriteInterleaved /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_store.c:1877:9
    #5 0x941072 in WriteToFile /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_store.c
    #6 0x9044ed in gf_isom_write /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_read.c:600:8
    #7 0x9050a3 in gf_isom_close /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_read.c:624:6
    #8 0x4ec23c in mp4boxMain /zhengjie/cmdline-fuzz/programs/mp4box/build2/applications/mp4box/main.c:6547:7
    #9 0x7f69758660b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #10 0x41ea6d in _start (/zhengjie/cmdline-fuzz/programs/mp4box/build2/bin/gcc/MP4Box+0x41ea6d)

0x602000001052 is located 0 bytes to the right of 2-byte region [0x602000001050,0x602000001052)
allocated by thread T0 here:
    #0 0x499ccd in malloc (/zhengjie/cmdline-fuzz/programs/mp4box/build2/bin/gcc/MP4Box+0x499ccd)
    #1 0xa5833b in afrt_box_read /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_code_adobe.c:683:27
    #2 0x8d658d in gf_isom_box_parse_ex /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_funcs.c:264:14
    #3 0x8d55bd in gf_isom_parse_root_box /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_funcs.c:38:8
    #4 0x8f48fd in gf_isom_parse_movie_boxes_internal /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_intern.c:321:7
    #5 0x8fa4bb in gf_isom_open_file /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_intern.c:904:19
    #6 0x4e5396 in mp4boxMain /zhengjie/cmdline-fuzz/programs/mp4box/build2/applications/mp4box/main.c:5984:12
    #7 0x7f69758660b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/zhengjie/cmdline-fuzz/programs/mp4box/build2/bin/gcc/MP4Box+0x430bd5) in strlen
Shadow bytes around the buggy address:
  0x0c047fff81b0: fa fa 07 fa fa fa fd fa fa fa 04 fa fa fa 00 02
  0x0c047fff81c0: fa fa fd fa fa fa 00 07 fa fa 00 00 fa fa 00 00
  0x0c047fff81d0: fa fa 00 fa fa fa fd fa fa fa 00 00 fa fa fd fa
  0x0c047fff81e0: fa fa 00 00 fa fa 00 00 fa fa 00 07 fa fa 00 07
  0x0c047fff81f0: fa fa 00 07 fa fa 00 02 fa fa 00 02 fa fa 00 02
=>0x0c047fff8200: fa fa 00 02 fa fa 02 fa fa fa[02]fa fa fa 00 00
  0x0c047fff8210: fa fa 00 00 fa fa 00 02 fa fa fd fd fa fa 00 00
  0x0c047fff8220: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8230: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8240: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8250: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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
==30134==ABORTING
/zhengjie/collect/collec.sh: line 13: 30134 Aborted (core dumped)
```
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-rev1663-g881c6a94a-master
```

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

## Crash command
MP4Box -isma -timescale 600 -out /dev/null poc_file

## Pocs
[poc.zip](https://github.com/gpac/gpac/files/7938896/poc.zip)

## Output
poc_21
```
------------------------
[iso file] Unknown top-level box type ip4p
[iso file] Unknown top-level box type 00010000
[iso file] Box "afrt" size 750 (start 193) invalid (read 984)
Converting to ISMA Audio-Video MP4 file
0.500 secs Interleaving
=================================================================
==30134==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000001052 at pc 0x000000430bd6 bp 0x7fffa7327d30 sp 0x7fffa73274f0
READ of size 3 at 0x602000001052 thread T0
    #0 0x430bd5 in strlen (/zhengjie/cmdline-fuzz/programs/mp4box/build2/bin/gcc/MP4Box+0x430bd5)
    #1 0xa593e8 in afrt_box_size /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_code_adobe.c:764:14
    #2 0x8da456 in gf_isom_box_size_listing /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_funcs.c:1913:9
    #3 0x8da456 in gf_isom_box_size /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_funcs.c:1925:6
    #4 0x945413 in WriteInterleaved /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_store.c:1877:9
    #5 0x941072 in WriteToFile /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_store.c
    #6 0x9044ed in gf_isom_write /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_read.c:600:8
    #7 0x9050a3 in gf_isom_close /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_read.c:624:6
    #8 0x4ec23c in mp4boxMain /zhengjie/cmdline-fuzz/programs/mp4box/build2/applications/mp4box/main.c:6547:7
    #9 0x7f69758660b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #10 0x41ea6d in _start (/zhengjie/cmdline-fuzz/programs/mp4box/build2/bin/gcc/MP4Box+0x41ea6d)

0x602000001052 is located 0 bytes to the right of 2-byte region [0x602000001050,0x602000001052)
allocated by thread T0 here:
    #0 0x499ccd in malloc (/zhengjie/cmdline-fuzz/programs/mp4box/build2/bin/gcc/MP4Box+0x499ccd)
    #1 0xa5833b in afrt_box_read /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_code_adobe.c:683:27
    #2 0x8d658d in gf_isom_box_parse_ex /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_funcs.c:264:14
    #3 0x8d55bd in gf_isom_parse_root_box /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/box_funcs.c:38:8
    #4 0x8f48fd in gf_isom_parse_movie_boxes_internal /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_intern.c:321:7
    #5 0x8fa4bb in gf_isom_open_file /zhengjie/cmdline-fuzz/programs/mp4box/build2/src/isomedia/isom_intern.c:904:19
    #6 0x4e5396 in mp4boxMain /zhengjie/cmdline-fuzz/programs/mp4box/build2/applications/mp4box/main.c:5984:12
    #7 0x7f69758660b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/zhengjie/cmdline-fuzz/programs/mp4box/build2/bin/gcc/MP4Box+0x430bd5) in strlen
Shadow bytes around the buggy address:
  0x0c047fff81b0: fa fa 07 fa fa fa fd fa fa fa 04 fa fa fa 00 02
  0x0c047fff81c0: fa fa fd fa fa fa 00 07 fa fa 00 00 fa fa 00 00
  0x0c047fff81d0: fa fa 00 fa fa fa fd fa fa fa 00 00 fa fa fd fa
  0x0c047fff81e0: fa fa 00 00 fa fa 00 00 fa fa 00 07 fa fa 00 07
  0x0c047fff81f0: fa fa 00 07 fa fa 00 02 fa fa 00 02 fa fa 00 02
=>0x0c047fff8200: fa fa 00 02 fa fa 02 fa fa fa[02]fa fa fa 00 00
  0x0c047fff8210: fa fa 00 00 fa fa 00 02 fa fa fd fd fa fa 00 00
  0x0c047fff8220: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8230: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8240: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8250: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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
==30134==ABORTING
/zhengjie/collect/collec.sh: line 13: 30134 Aborted (core dumped)
```
--- end body ---
