Hi, developers of Bento4:
In the test of the binary **mp4hls** instrumented with ASAN.  There are some input causing heap-buffer-overflow in function **AP4_Mp4AudioDecoderConfig::ParseExtension(AP4_Mp4AudioDsiParser&)**. Here is the asan mode output:

```
=================================================================
==33387==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000234 at pc 0x5622652f1f60 bp 0x7ffd29059d30 sp 0x7ffd29059d28
READ of size 1 at 0x602000000234 thread T0
    #0 0x5622652f1f5f in AP4_Mp4AudioDecoderConfig::ParseExtension(AP4_Mp4AudioDsiParser&) (/workspace/test/validate/Bento4/check_build/mp42hls+0x139f5f) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #1 0x5622652f3594 in AP4_Mp4AudioDecoderConfig::Parse(unsigned char const*, unsigned int) (/workspace/test/validate/Bento4/check_build/mp42hls+0x13b594) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #2 0x562265355c7f in AP4_Mpeg2TsAudioSampleStream::WriteSample(AP4_Sample&, AP4_DataBuffer&, AP4_SampleDescription*, bool, AP4_ByteStream&) (/workspace/test/validate/Bento4/check_build/mp42hls+0x19dc7f) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #3 0x5622652ea28c in main (/workspace/test/validate/Bento4/check_build/mp42hls+0x13228c) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #4 0x7fe0d15e4d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)
    #5 0x7fe0d15e4e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)
    #6 0x56226521ebe4 in _start (/workspace/test/validate/Bento4/check_build/mp42hls+0x66be4) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)

0x602000000234 is located 0 bytes to the right of 4-byte region [0x602000000230,0x602000000234)
allocated by thread T0 here:
    #0 0x5622652dc90d in operator new[](unsigned long) (/workspace/test/validate/Bento4/check_build/mp42hls+0x12490d) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #1 0x562265327a08 in AP4_DataBuffer::AP4_DataBuffer(void const*, unsigned int) (/workspace/test/validate/Bento4/check_build/mp42hls+0x16fa08) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #2 0x562265355c7f in AP4_Mpeg2TsAudioSampleStream::WriteSample(AP4_Sample&, AP4_DataBuffer&, AP4_SampleDescription*, bool, AP4_ByteStream&) (/workspace/test/validate/Bento4/check_build/mp42hls+0x19dc7f) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #3 0x5622652ea28c in main (/workspace/test/validate/Bento4/check_build/mp42hls+0x13228c) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #4 0x7fe0d15e4d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/workspace/test/validate/Bento4/check_build/mp42hls+0x139f5f) (BuildId: 5b3926cf6a812b14754d91115945185b870473da) in AP4_Mp4AudioDecoderConfig::ParseExtension(AP4_Mp4AudioDsiParser&)
Shadow bytes around the buggy address:
  0x0c047fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff8000: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa fd fd
  0x0c047fff8010: fa fa 04 fa fa fa fd fd fa fa 00 05 fa fa 04 fa
  0x0c047fff8020: fa fa 00 fa fa fa fd fd fa fa 04 fa fa fa fd fa
  0x0c047fff8030: fa fa fd fa fa fa 01 fa fa fa 00 00 fa fa 00 00
=>0x0c047fff8040: fa fa 04 fa fa fa[04]fa fa fa fa fa fa fa fa fa
  0x0c047fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8090: 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
==33387==ABORTING
```
### Crash input:
https://github.com/Yhcrown/fuzzing-crashes/blob/main/validated/mp4hls/0

### Verification steps：

```
git clone https://github.com/axiomatic-systems/Bento4
cd Bento4/
mkdir check_build && cd check_build
cmake ../ -DCMAKE_C_COMPILER=clang  -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_CXX_FLAGS="-fsanitize=address" -DCMAKE_BUILD_TYPE=Release
make -j 
./mp42hls ./crash_input
```
enviroment:
Ubuntu 22.04 LTS
Linux lab-pro 4.15.0-147-generic
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Ubuntu clang version 14.0.6

**Thanks & Best regards !**

Heap-Buffer-Overflow with ASAN in mp42hls
This is a GitHub Issue
repo:Bento4
owner:axiomatic-systems
Title : Heap-Buffer-Overflow with ASAN in mp42hls
Issue date:

--- start body ---
Hi, developers of Bento4:
In the test of the binary **mp4hls** instrumented with ASAN.  There are some input causing heap-buffer-overflow in function **AP4_Mp4AudioDecoderConfig::ParseExtension(AP4_Mp4AudioDsiParser&)**. Here is the asan mode output:

```
=================================================================
==33387==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000234 at pc 0x5622652f1f60 bp 0x7ffd29059d30 sp 0x7ffd29059d28
READ of size 1 at 0x602000000234 thread T0
    #0 0x5622652f1f5f in AP4_Mp4AudioDecoderConfig::ParseExtension(AP4_Mp4AudioDsiParser&) (/workspace/test/validate/Bento4/check_build/mp42hls+0x139f5f) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #1 0x5622652f3594 in AP4_Mp4AudioDecoderConfig::Parse(unsigned char const*, unsigned int) (/workspace/test/validate/Bento4/check_build/mp42hls+0x13b594) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #2 0x562265355c7f in AP4_Mpeg2TsAudioSampleStream::WriteSample(AP4_Sample&, AP4_DataBuffer&, AP4_SampleDescription*, bool, AP4_ByteStream&) (/workspace/test/validate/Bento4/check_build/mp42hls+0x19dc7f) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #3 0x5622652ea28c in main (/workspace/test/validate/Bento4/check_build/mp42hls+0x13228c) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #4 0x7fe0d15e4d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)
    #5 0x7fe0d15e4e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)
    #6 0x56226521ebe4 in _start (/workspace/test/validate/Bento4/check_build/mp42hls+0x66be4) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)

0x602000000234 is located 0 bytes to the right of 4-byte region [0x602000000230,0x602000000234)
allocated by thread T0 here:
    #0 0x5622652dc90d in operator new[](unsigned long) (/workspace/test/validate/Bento4/check_build/mp42hls+0x12490d) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #1 0x562265327a08 in AP4_DataBuffer::AP4_DataBuffer(void const*, unsigned int) (/workspace/test/validate/Bento4/check_build/mp42hls+0x16fa08) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #2 0x562265355c7f in AP4_Mpeg2TsAudioSampleStream::WriteSample(AP4_Sample&, AP4_DataBuffer&, AP4_SampleDescription*, bool, AP4_ByteStream&) (/workspace/test/validate/Bento4/check_build/mp42hls+0x19dc7f) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #3 0x5622652ea28c in main (/workspace/test/validate/Bento4/check_build/mp42hls+0x13228c) (BuildId: 5b3926cf6a812b14754d91115945185b870473da)
    #4 0x7fe0d15e4d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/workspace/test/validate/Bento4/check_build/mp42hls+0x139f5f) (BuildId: 5b3926cf6a812b14754d91115945185b870473da) in AP4_Mp4AudioDecoderConfig::ParseExtension(AP4_Mp4AudioDsiParser&)
Shadow bytes around the buggy address:
  0x0c047fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff8000: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa fd fd
  0x0c047fff8010: fa fa 04 fa fa fa fd fd fa fa 00 05 fa fa 04 fa
  0x0c047fff8020: fa fa 00 fa fa fa fd fd fa fa 04 fa fa fa fd fa
  0x0c047fff8030: fa fa fd fa fa fa 01 fa fa fa 00 00 fa fa 00 00
=>0x0c047fff8040: fa fa 04 fa fa fa[04]fa fa fa fa fa fa fa fa fa
  0x0c047fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8090: 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
==33387==ABORTING
```
### Crash input:
https://github.com/Yhcrown/fuzzing-crashes/blob/main/validated/mp4hls/0

### Verification steps：

```
git clone https://github.com/axiomatic-systems/Bento4
cd Bento4/
mkdir check_build && cd check_build
cmake ../ -DCMAKE_C_COMPILER=clang  -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_CXX_FLAGS="-fsanitize=address" -DCMAKE_BUILD_TYPE=Release
make -j 
./mp42hls ./crash_input
```
enviroment:
Ubuntu 22.04 LTS
Linux lab-pro 4.15.0-147-generic
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Ubuntu clang version 14.0.6

**Thanks & Best regards !**

--- end body ---
