Hi, there.

There is a reachable assertion failure in mp4info,  Ap4Atom.cpp:763, in the newest commit 5b7cc250. This issue seems to be an incomplete fix of issues #197, #351, and #547.

To reproduce, run:
~~~~
./mp4info poc /dev/null
~~~~

Here is the trace reported by ASAN:
~~~~
==3028932==ERROR: AddressSanitizer: ABRT on unknown address 0x03ea002e37c4 (pc 0x7fb712c6e00b bp 0x7fb712de3588 sp 0x7ffd90cb0930 T0)
     #0 0x7fb712c6e00b in raise /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
     #1 0x7fb712c4d858 in abort /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:79:7
     #2 0x7fb712c4d728 in __assert_fail_base /build/glibc-SzIz7B/glibc-2.31/assert/assert.c:92:3
     #3 0x7fb712c5efd5 in __assert_fail /build/glibc-SzIz7B/glibc-2.31/assert/assert.c:101:3
     #4 0x5286f0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:763:5
     #5 0x5f2c92 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
     #6 0x5f2c92 in AP4_SampleEntry::Write(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4SampleEntry.cpp:176:23
     #7 0x523d0c in AP4_Atom::Clone() /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:316:9
     #8 0x553d57 in AP4_ContainerAtom::Clone() /home/heqing/benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:172:56
     #9 0x553d57 in AP4_ContainerAtom::Clone() /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:172:56
     #10 0x553d57 in AP4_ContainerAtom::Clone() /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:172:56
     #11 0x553d57 in AP4_ContainerAtom::Clone() /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:172:56
     #12 0x5e6fa1 in AP4_SampleDescription::AP4_SampleDescription(AP4_SampleDescription::Type, unsigned int, AP4_AtomParent*) /benchmark/Bento4/Source/C++/Core/Ap4SampleDescription.cpp:138:41
     #13 0x5e6fa1 in AP4_AvcSampleDescription::AP4_AvcSampleDescription(unsigned int, unsigned short, unsigned short, unsigned short, char const*, AP4_AtomParent*) /benchmark/Bento4/Source/C++/Core/Ap4SampleDescription.cpp:383:5
     #14 0x5fb814 in AP4_AvcSampleEntry::ToSampleDescription() /benchmark/Bento4/Source/C++/Core/Ap4SampleEntry.cpp:1146:16
     #15 0x6144a4 in AP4_StsdAtom::GetSampleDescription(unsigned int) /benchmark/Bento4/Source/C++/Core/Ap4StsdAtom.cpp:181:53
     #16 0x500666 in ShowTrackInfo_Text(AP4_Movie&, AP4_Track&, AP4_ByteStream&, bool, bool, bool, bool) /benchmark/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1351:52
     #17 0x500666 in ShowTrackInfo(AP4_Movie&, AP4_Track&, AP4_ByteStream&, bool, bool, bool, bool) /benchmark/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1475:13
     #18 0x4ff54d in ShowTracks(AP4_Movie&, AP4_List<AP4_Track>&, AP4_ByteStream&, bool, bool, bool, bool) /benchmark/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1586:9
     #19 0x4fbd0f in main /benchmark/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1868:13
     #20 0x7fb712c4f082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
     #21 0x41d89d in _start (/benchmark/Bento4/build-a/mp4info+0x41d89d)
 
 AddressSanitizer can not provide additional info.
 SUMMARY: AddressSanitizer: ABRT /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1 in raise
 ==3028932==ABORTIN
~~~~

[mp4info_assertion_Ap4Atom.cpp763.zip](https://github.com/axiomatic-systems/Bento4/files/9642730/mp4info_assertion_Ap4Atom.cpp763.zip)
(unzip first)
Assertion Failure in mp4info, Ap4Atom.cpp:763
This is a GitHub Issue
repo:Bento4
owner:axiomatic-systems
Title : Assertion Failure in mp4info, Ap4Atom.cpp:763
Issue date:

--- start body ---
Hi, there.

There is a reachable assertion failure in mp4info,  Ap4Atom.cpp:763, in the newest commit 5b7cc250. This issue seems to be an incomplete fix of issues #197, #351, and #547.

To reproduce, run:
~~~~
./mp4info poc /dev/null
~~~~

Here is the trace reported by ASAN:
~~~~
==3028932==ERROR: AddressSanitizer: ABRT on unknown address 0x03ea002e37c4 (pc 0x7fb712c6e00b bp 0x7fb712de3588 sp 0x7ffd90cb0930 T0)
     #0 0x7fb712c6e00b in raise /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
     #1 0x7fb712c4d858 in abort /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:79:7
     #2 0x7fb712c4d728 in __assert_fail_base /build/glibc-SzIz7B/glibc-2.31/assert/assert.c:92:3
     #3 0x7fb712c5efd5 in __assert_fail /build/glibc-SzIz7B/glibc-2.31/assert/assert.c:101:3
     #4 0x5286f0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:763:5
     #5 0x5f2c92 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
     #6 0x5f2c92 in AP4_SampleEntry::Write(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4SampleEntry.cpp:176:23
     #7 0x523d0c in AP4_Atom::Clone() /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:316:9
     #8 0x553d57 in AP4_ContainerAtom::Clone() /home/heqing/benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:172:56
     #9 0x553d57 in AP4_ContainerAtom::Clone() /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:172:56
     #10 0x553d57 in AP4_ContainerAtom::Clone() /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:172:56
     #11 0x553d57 in AP4_ContainerAtom::Clone() /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:172:56
     #12 0x5e6fa1 in AP4_SampleDescription::AP4_SampleDescription(AP4_SampleDescription::Type, unsigned int, AP4_AtomParent*) /benchmark/Bento4/Source/C++/Core/Ap4SampleDescription.cpp:138:41
     #13 0x5e6fa1 in AP4_AvcSampleDescription::AP4_AvcSampleDescription(unsigned int, unsigned short, unsigned short, unsigned short, char const*, AP4_AtomParent*) /benchmark/Bento4/Source/C++/Core/Ap4SampleDescription.cpp:383:5
     #14 0x5fb814 in AP4_AvcSampleEntry::ToSampleDescription() /benchmark/Bento4/Source/C++/Core/Ap4SampleEntry.cpp:1146:16
     #15 0x6144a4 in AP4_StsdAtom::GetSampleDescription(unsigned int) /benchmark/Bento4/Source/C++/Core/Ap4StsdAtom.cpp:181:53
     #16 0x500666 in ShowTrackInfo_Text(AP4_Movie&, AP4_Track&, AP4_ByteStream&, bool, bool, bool, bool) /benchmark/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1351:52
     #17 0x500666 in ShowTrackInfo(AP4_Movie&, AP4_Track&, AP4_ByteStream&, bool, bool, bool, bool) /benchmark/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1475:13
     #18 0x4ff54d in ShowTracks(AP4_Movie&, AP4_List<AP4_Track>&, AP4_ByteStream&, bool, bool, bool, bool) /benchmark/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1586:9
     #19 0x4fbd0f in main /benchmark/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1868:13
     #20 0x7fb712c4f082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
     #21 0x41d89d in _start (/benchmark/Bento4/build-a/mp4info+0x41d89d)
 
 AddressSanitizer can not provide additional info.
 SUMMARY: AddressSanitizer: ABRT /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1 in raise
 ==3028932==ABORTIN
~~~~

[mp4info_assertion_Ap4Atom.cpp763.zip](https://github.com/axiomatic-systems/Bento4/files/9642730/mp4info_assertion_Ap4Atom.cpp763.zip)
(unzip first)
--- end body ---
