## System info

Ubuntu 16.04 xenial, gcc (Ubuntu 5.5.0-12ubuntu1), Bento4 (latest master [8a2bf3](https://github.com/axiomatic-systems/Bento4/commit/8a2bf3081e610bc145e8df3b10671dad839dd007))

## **Command line**

mp4info --show-layout --show-samples --show-sample-data @@

## Output

```bash
File:
  major brand:      mp42
  minor version:    12a007e
  compatible brand: mp42
  compatible brand: isom
  fast start:       no

Movie:
  duration:   90000 (media timescale units)
  duration:   1000 (ms)
  time scale: 90000
  fragments:  no

Found 1 Tracks
Track 1:
  flags:        7 ENABLED IN-MOVIE IN-PREVIEW
  id:           -16777215
  type:         Unknown []
  duration: 1000 ms
  language: (null)
  media:
    sample count: 0
    timescale:    0
    duration:     0 (media timescale units)
    duration:     0 (ms)
    bitrate (computed): 0.000 Kbps
  display width:  48.000000
  display height: 144.000000
  Sample Description 0
    Coding:       avc1 (H.264)
[1]    72003 segmentation fault  ./crashes-binary/gcc-asan/bento4/gcc-mp4info --show-layout --show-samples
```

## AddressSanitizer output

```bash
File:
  major brand:      mp42
  minor version:    12a007e
  compatible brand: mp42
  compatible brand: isom
  fast start:       no

Movie:
  duration:   90000 (media timescale units)
  duration:   1000 (ms)
  time scale: 90000
  fragments:  no

Found 1 Tracks
Track 1:
  flags:        7 ENABLED IN-MOVIE IN-PREVIEW
  id:           -16777215
  type:         Unknown []
  duration: 1000 ms
  language: (null)
  media:
    sample count: 0
    timescale:    0
    duration:     0 (media timescale units)
    duration:     0 (ms)
    bitrate (computed): 0.000 Kbps
  display width:  48.000000
  display height: 144.000000
  Sample Description 0
    Coding:       avc1 (H.264)
ASAN:SIGSEGV
=================================================================
==63888==ERROR: AddressSanitizer: stack-overflow on address 0x7ffc4b846f98 (pc 0x0000004a19f0 bp 0x7ffc4b8470c0 sp 0x7ffc4b846f80 T0)
    #0 0x4a19ef in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:398
    #1 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171
    #2 0x4a1b02 in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:402
    #3 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171
    #4 0x4a1b02 in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:402
    #5 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171
    #6 0x4a1b02 in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:402
    #7 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171
    #8 0x4a1b02 in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:402
    #9 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171
    ...
    #250 0x4a1b02 in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:402
    #251 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171

SUMMARY: AddressSanitizer: stack-overflow ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:398 AP4_AvcSampleDescription::GetCodecString(AP4_String&)
==63888==ABORTING
```
## POC
[StackOverflow-GetCodecString-Ap4SampleDescription_cpp-402.zip](https://github.com/axiomatic-systems/Bento4/files/6852538/StackOverflow-GetCodecString-Ap4SampleDescription_cpp-402.zip)

StackOverflow-GetCodecString-Ap4SampleDescription_cpp-402-Ap4SampleDescription.cpp:398
This is a GitHub Issue
repo:Bento4
owner:axiomatic-systems
Title : StackOverflow-GetCodecString-Ap4SampleDescription_cpp-402-Ap4SampleDescription.cpp:398
Issue date:

--- start body ---
## System info

Ubuntu 16.04 xenial, gcc (Ubuntu 5.5.0-12ubuntu1), Bento4 (latest master [8a2bf3](https://github.com/axiomatic-systems/Bento4/commit/8a2bf3081e610bc145e8df3b10671dad839dd007))

## **Command line**

mp4info --show-layout --show-samples --show-sample-data @@

## Output

```bash
File:
  major brand:      mp42
  minor version:    12a007e
  compatible brand: mp42
  compatible brand: isom
  fast start:       no

Movie:
  duration:   90000 (media timescale units)
  duration:   1000 (ms)
  time scale: 90000
  fragments:  no

Found 1 Tracks
Track 1:
  flags:        7 ENABLED IN-MOVIE IN-PREVIEW
  id:           -16777215
  type:         Unknown []
  duration: 1000 ms
  language: (null)
  media:
    sample count: 0
    timescale:    0
    duration:     0 (media timescale units)
    duration:     0 (ms)
    bitrate (computed): 0.000 Kbps
  display width:  48.000000
  display height: 144.000000
  Sample Description 0
    Coding:       avc1 (H.264)
[1]    72003 segmentation fault  ./crashes-binary/gcc-asan/bento4/gcc-mp4info --show-layout --show-samples
```

## AddressSanitizer output

```bash
File:
  major brand:      mp42
  minor version:    12a007e
  compatible brand: mp42
  compatible brand: isom
  fast start:       no

Movie:
  duration:   90000 (media timescale units)
  duration:   1000 (ms)
  time scale: 90000
  fragments:  no

Found 1 Tracks
Track 1:
  flags:        7 ENABLED IN-MOVIE IN-PREVIEW
  id:           -16777215
  type:         Unknown []
  duration: 1000 ms
  language: (null)
  media:
    sample count: 0
    timescale:    0
    duration:     0 (media timescale units)
    duration:     0 (ms)
    bitrate (computed): 0.000 Kbps
  display width:  48.000000
  display height: 144.000000
  Sample Description 0
    Coding:       avc1 (H.264)
ASAN:SIGSEGV
=================================================================
==63888==ERROR: AddressSanitizer: stack-overflow on address 0x7ffc4b846f98 (pc 0x0000004a19f0 bp 0x7ffc4b8470c0 sp 0x7ffc4b846f80 T0)
    #0 0x4a19ef in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:398
    #1 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171
    #2 0x4a1b02 in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:402
    #3 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171
    #4 0x4a1b02 in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:402
    #5 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171
    #6 0x4a1b02 in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:402
    #7 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171
    #8 0x4a1b02 in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:402
    #9 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171
    ...
    #250 0x4a1b02 in AP4_AvcSampleDescription::GetCodecString(AP4_String&) ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:402
    #251 0x455c1e in AP4_DvccAtom::GetCodecString(AP4_SampleDescription*, AP4_String&) ../../bento4/Source/C++/Core/Ap4DvccAtom.cpp:171

SUMMARY: AddressSanitizer: stack-overflow ../../bento4/Source/C++/Core/Ap4SampleDescription.cpp:398 AP4_AvcSampleDescription::GetCodecString(AP4_String&)
==63888==ABORTING
```
## POC
[StackOverflow-GetCodecString-Ap4SampleDescription_cpp-402.zip](https://github.com/axiomatic-systems/Bento4/files/6852538/StackOverflow-GetCodecString-Ap4SampleDescription_cpp-402.zip)

--- end body ---
