Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

A null pointer dereference was discovered in gf_node_get_field_count(). The vulnerability causes a segmentation fault and application crash.

**Version:**

```
MP4Box - GPAC version 1.1.0-DEV-revUNKNOWN_REV
(c) 2000-2021 Telecom Paris distributed under LGPL v2.1+ - http://gpac.io

Please cite our work in your research:
        GPAC Filters: https://doi.org/10.1145/3339825.3394929
        GPAC: https://doi.org/10.1145/1291233.1291452

GPAC Configuration:
Features: GPAC_CONFIG_LINUX GPAC_64_BITS GPAC_HAS_IPV6 GPAC_HAS_SOCK_UN GPAC_MINIMAL_ODF GPAC_HAS_QJS GPAC_HAS_JPEG GPAC_HAS_PNG GPAC_HAS_LINUX_DVB  GPAC_DISABLE_3D
```
**System information**
Ubuntu 20.04 focal, AMD EPYC 7742 64-Core @ 16x 2.25GHz

**command:**

```
./MP4Box -bt poc_10
```
[poc_10.zip](https://github.com/gpac/gpac/files/7696161/poc_10.zip)

**Result**

```
[iso file] extra box maxr found in hinf, deleting
[iso file] Unknown box type traI in parent moov
[iso file] Box "stss" (start 9939) has 32 extra bytes
[iso file] extra box maxr found in hinf, deleting
[iso file] Track with no sample description box !
[iso file] Incomplete box mdat - start 11495 size 861261
[iso file] Incomplete file while reading for dump - aborting parsing
[iso file] extra box maxr found in hinf, deleting
[iso file] Unknown box type traI in parent moov
[iso file] Box "stss" (start 9939) has 32 extra bytes
[iso file] extra box maxr found in hinf, deleting
[iso file] Track with no sample description box !
[iso file] Incomplete box mdat - start 11495 size 861261
[iso file] Incomplete file while reading for dump - aborting parsing
MPEG-4 BIFS Scene Parsing
[1]    3708974 segmentation fault  ./MP4Box -bt ./poc/poc_10
```

**gdb**

```
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff784a747 in gf_node_get_field_count () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
LEGEND: STACK | HEAP | CODE | DATA | RWX | RODATA
────────────────────────────────────────────[ REGISTERS ]─────────────────────────────────────────────
 RAX  0x0
 RBX  0x0
 RCX  0x2
 RDX  0x5555555da000 ◂— 0x0
 RDI  0x5555555da340 ◂— 0x0
 RSI  0x5555555da020 —▸ 0x5555555da000 ◂— 0x0
 R8   0x1
 R9   0x0
 R10  0x7ffff775bac3 ◂— 'gf_node_get_field_count'
 R11  0x7ffff784a740 (gf_node_get_field_count) ◂— endbr64
 R12  0x5555555db570 —▸ 0x5555555db5d0 ◂— 0x800000010001002d /* '-' */
 R13  0x5555555d9210 ◂— 0x0
 R14  0x5555555da340 ◂— 0x0
 R15  0x7fffffff6c20 ◂— 0x0
 RBP  0x5555555def40 ◂— 0x0
 RSP  0x7fffffff6bf8 —▸ 0x7ffff784b5e5 (gf_sg_reset+661) ◂— xor    ecx, ecx
 RIP  0x7ffff784a747 (gf_node_get_field_count+7) ◂— movzx  eax, word ptr [rax]
──────────────────────────────────────────────[ DISASM ]──────────────────────────────────────────────
 ► 0x7ffff784a747 <gf_node_get_field_count+7>         movzx  eax, word ptr [rax]
   0x7ffff784a74a <gf_node_get_field_count+10>        test   ax, ax
   0x7ffff784a74d <gf_node_get_field_count+13>        je     gf_node_get_field_count+27
 <gf_node_get_field_count+27>
    ↓
   0x7ffff784a75b <gf_node_get_field_count+27>        xor    eax, eax
   0x7ffff784a75d <gf_node_get_field_count+29>        ret

   0x7ffff784a75e <gf_node_get_field_count+30>        nop
   0x7ffff784a760 <gf_node_get_field_count+32>        jmp    gf_node_get_attribute_count
  <gf_node_get_attribute_count>
    ↓
   0x7ffff78e1a80 <gf_node_get_attribute_count>       endbr64
   0x7ffff78e1a84 <gf_node_get_attribute_count+4>     test   rdi, rdi
   0x7ffff78e1a87 <gf_node_get_attribute_count+7>     je     gf_node_get_attribute_count+48
     <gf_node_get_attribute_count+48>
    ↓
   0x7ffff78e1ab0 <gf_node_get_attribute_count+48>    xor    r8d, r8d
──────────────────────────────────────────────[ STACK ]───────────────────────────────────────────────
00:0000│ rsp 0x7fffffff6bf8 —▸ 0x7ffff784b5e5 (gf_sg_reset+661) ◂— xor    ecx, ecx
01:0008│     0x7fffffff6c00 —▸ 0x5555555db570 —▸ 0x5555555db5d0 ◂— 0x800000010001002d /* '-' */
02:0010│     0x7fffffff6c08 ◂— 0x3100000006
03:0018│     0x7fffffff6c10 —▸ 0x5555555def10 ◂— 0x0
04:0020│     0x7fffffff6c18 ◂— 0x2d000000000000
05:0028│ r15 0x7fffffff6c20 ◂— 0x0
06:0030│     0x7fffffff6c28 ◂— 0x770000007c /* '|' */
07:0038│     0x7fffffff6c30 ◂— 0x5b0000006e /* 'n' */
────────────────────────────────────────────[ BACKTRACE ]─────────────────────────────────────────────
 ► f 0   0x7ffff784a747 gf_node_get_field_count+7
   f 1   0x7ffff784b5e5 gf_sg_reset+661
   f 2   0x7ffff784ba47 gf_sg_del+55
   f 3   0x7ffff788b7f8 gf_sg_proto_del+424
   f 4   0x7ffff7905f88 gf_bifs_dec_proto_list+680
   f 5   0x7ffff7913a11 BM_ParseInsert+769
   f 6   0x7ffff7914fe1 BM_ParseCommand+113
   f 7   0x7ffff7915353 gf_bifs_decode_command_list+163
──────────────────────────────────────────────────────────────────────────────────────────────────────
pwndbg> bt
#0  0x00007ffff784a747 in gf_node_get_field_count () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#1  0x00007ffff784b5e5 in gf_sg_reset () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#2  0x00007ffff784ba47 in gf_sg_del () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#3  0x00007ffff788b7f8 in gf_sg_proto_del () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#4  0x00007ffff7905f88 in gf_bifs_dec_proto_list () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#5  0x00007ffff7913a11 in BM_ParseInsert () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#6  0x00007ffff7914fe1 in BM_ParseCommand () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#7  0x00007ffff7915353 in gf_bifs_decode_command_list () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#8  0x00007ffff7aa1d91 in gf_sm_load_run_isom () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#9  0x00005555555844a8 in dump_isom_scene ()
#10 0x000055555557b42c in mp4boxMain ()
#11 0x00007ffff75630b3 in __libc_start_main (main=0x55555556c420 <main>, argc=3, argv=0x7fffffffe218, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe208) at ../csu/libc-start.c:308
#12 0x000055555556c45e in _start ()
```


Null Pointer Dereference in gf_node_get_field_count()
This is a GitHub Issue
repo:gpac
owner:gpac
Title : Null Pointer Dereference in gf_node_get_field_count()
Issue date:

--- start body ---
Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

A null pointer dereference was discovered in gf_node_get_field_count(). The vulnerability causes a segmentation fault and application crash.

**Version:**

```
MP4Box - GPAC version 1.1.0-DEV-revUNKNOWN_REV
(c) 2000-2021 Telecom Paris distributed under LGPL v2.1+ - http://gpac.io

Please cite our work in your research:
        GPAC Filters: https://doi.org/10.1145/3339825.3394929
        GPAC: https://doi.org/10.1145/1291233.1291452

GPAC Configuration:
Features: GPAC_CONFIG_LINUX GPAC_64_BITS GPAC_HAS_IPV6 GPAC_HAS_SOCK_UN GPAC_MINIMAL_ODF GPAC_HAS_QJS GPAC_HAS_JPEG GPAC_HAS_PNG GPAC_HAS_LINUX_DVB  GPAC_DISABLE_3D
```
**System information**
Ubuntu 20.04 focal, AMD EPYC 7742 64-Core @ 16x 2.25GHz

**command:**

```
./MP4Box -bt poc_10
```
[poc_10.zip](https://github.com/gpac/gpac/files/7696161/poc_10.zip)

**Result**

```
[iso file] extra box maxr found in hinf, deleting
[iso file] Unknown box type traI in parent moov
[iso file] Box "stss" (start 9939) has 32 extra bytes
[iso file] extra box maxr found in hinf, deleting
[iso file] Track with no sample description box !
[iso file] Incomplete box mdat - start 11495 size 861261
[iso file] Incomplete file while reading for dump - aborting parsing
[iso file] extra box maxr found in hinf, deleting
[iso file] Unknown box type traI in parent moov
[iso file] Box "stss" (start 9939) has 32 extra bytes
[iso file] extra box maxr found in hinf, deleting
[iso file] Track with no sample description box !
[iso file] Incomplete box mdat - start 11495 size 861261
[iso file] Incomplete file while reading for dump - aborting parsing
MPEG-4 BIFS Scene Parsing
[1]    3708974 segmentation fault  ./MP4Box -bt ./poc/poc_10
```

**gdb**

```
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff784a747 in gf_node_get_field_count () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
LEGEND: STACK | HEAP | CODE | DATA | RWX | RODATA
────────────────────────────────────────────[ REGISTERS ]─────────────────────────────────────────────
 RAX  0x0
 RBX  0x0
 RCX  0x2
 RDX  0x5555555da000 ◂— 0x0
 RDI  0x5555555da340 ◂— 0x0
 RSI  0x5555555da020 —▸ 0x5555555da000 ◂— 0x0
 R8   0x1
 R9   0x0
 R10  0x7ffff775bac3 ◂— 'gf_node_get_field_count'
 R11  0x7ffff784a740 (gf_node_get_field_count) ◂— endbr64
 R12  0x5555555db570 —▸ 0x5555555db5d0 ◂— 0x800000010001002d /* '-' */
 R13  0x5555555d9210 ◂— 0x0
 R14  0x5555555da340 ◂— 0x0
 R15  0x7fffffff6c20 ◂— 0x0
 RBP  0x5555555def40 ◂— 0x0
 RSP  0x7fffffff6bf8 —▸ 0x7ffff784b5e5 (gf_sg_reset+661) ◂— xor    ecx, ecx
 RIP  0x7ffff784a747 (gf_node_get_field_count+7) ◂— movzx  eax, word ptr [rax]
──────────────────────────────────────────────[ DISASM ]──────────────────────────────────────────────
 ► 0x7ffff784a747 <gf_node_get_field_count+7>         movzx  eax, word ptr [rax]
   0x7ffff784a74a <gf_node_get_field_count+10>        test   ax, ax
   0x7ffff784a74d <gf_node_get_field_count+13>        je     gf_node_get_field_count+27
 <gf_node_get_field_count+27>
    ↓
   0x7ffff784a75b <gf_node_get_field_count+27>        xor    eax, eax
   0x7ffff784a75d <gf_node_get_field_count+29>        ret

   0x7ffff784a75e <gf_node_get_field_count+30>        nop
   0x7ffff784a760 <gf_node_get_field_count+32>        jmp    gf_node_get_attribute_count
  <gf_node_get_attribute_count>
    ↓
   0x7ffff78e1a80 <gf_node_get_attribute_count>       endbr64
   0x7ffff78e1a84 <gf_node_get_attribute_count+4>     test   rdi, rdi
   0x7ffff78e1a87 <gf_node_get_attribute_count+7>     je     gf_node_get_attribute_count+48
     <gf_node_get_attribute_count+48>
    ↓
   0x7ffff78e1ab0 <gf_node_get_attribute_count+48>    xor    r8d, r8d
──────────────────────────────────────────────[ STACK ]───────────────────────────────────────────────
00:0000│ rsp 0x7fffffff6bf8 —▸ 0x7ffff784b5e5 (gf_sg_reset+661) ◂— xor    ecx, ecx
01:0008│     0x7fffffff6c00 —▸ 0x5555555db570 —▸ 0x5555555db5d0 ◂— 0x800000010001002d /* '-' */
02:0010│     0x7fffffff6c08 ◂— 0x3100000006
03:0018│     0x7fffffff6c10 —▸ 0x5555555def10 ◂— 0x0
04:0020│     0x7fffffff6c18 ◂— 0x2d000000000000
05:0028│ r15 0x7fffffff6c20 ◂— 0x0
06:0030│     0x7fffffff6c28 ◂— 0x770000007c /* '|' */
07:0038│     0x7fffffff6c30 ◂— 0x5b0000006e /* 'n' */
────────────────────────────────────────────[ BACKTRACE ]─────────────────────────────────────────────
 ► f 0   0x7ffff784a747 gf_node_get_field_count+7
   f 1   0x7ffff784b5e5 gf_sg_reset+661
   f 2   0x7ffff784ba47 gf_sg_del+55
   f 3   0x7ffff788b7f8 gf_sg_proto_del+424
   f 4   0x7ffff7905f88 gf_bifs_dec_proto_list+680
   f 5   0x7ffff7913a11 BM_ParseInsert+769
   f 6   0x7ffff7914fe1 BM_ParseCommand+113
   f 7   0x7ffff7915353 gf_bifs_decode_command_list+163
──────────────────────────────────────────────────────────────────────────────────────────────────────
pwndbg> bt
#0  0x00007ffff784a747 in gf_node_get_field_count () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#1  0x00007ffff784b5e5 in gf_sg_reset () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#2  0x00007ffff784ba47 in gf_sg_del () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#3  0x00007ffff788b7f8 in gf_sg_proto_del () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#4  0x00007ffff7905f88 in gf_bifs_dec_proto_list () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#5  0x00007ffff7913a11 in BM_ParseInsert () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#6  0x00007ffff7914fe1 in BM_ParseCommand () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#7  0x00007ffff7915353 in gf_bifs_decode_command_list () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#8  0x00007ffff7aa1d91 in gf_sm_load_run_isom () from /root/fuckit/test/gpac1210/bin/gcc/libgpac.so.10
#9  0x00005555555844a8 in dump_isom_scene ()
#10 0x000055555557b42c in mp4boxMain ()
#11 0x00007ffff75630b3 in __libc_start_main (main=0x55555556c420 <main>, argc=3, argv=0x7fffffffe218, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe208) at ../csu/libc-start.c:308
#12 0x000055555556c45e in _start ()
```


--- end body ---
