issue_owner_repo listlengths 2 2 | issue_body stringlengths 0 261k ⌀ | issue_title stringlengths 1 925 | issue_comments_url stringlengths 56 81 | issue_comments_count int64 0 2.5k | issue_created_at stringlengths 20 20 | issue_updated_at stringlengths 20 20 | issue_html_url stringlengths 37 62 | issue_github_id int64 387k 2.46B | issue_number int64 1 127k |
|---|---|---|---|---|---|---|---|---|---|
[
"axiomatic-systems",
"Bento4"
] | Hi. At you mp4mux.exe there is a problem audio track 2 will appear Error : Missing ID_END.
https://radikal.host/i/FBYjPT
The next version is fix. | mp4mux.exe Audio Missing ID_END | https://api.github.com/repos/axiomatic-systems/Bento4/issues/879/comments | 3 | 2023-07-16T09:27:14Z | 2023-08-06T07:34:30Z | https://github.com/axiomatic-systems/Bento4/issues/879 | 1,806,512,393 | 879 |
[
"axiomatic-systems",
"Bento4"
] | It is confusing about the audio track parameters, in your sample,
AP4_Track* track = new AP4_Track(AP4_Track::TYPE_AUDIO,
sample_table,
0, // track id
sample_rate, // movie time scale
sample_count*1024, // track duration
sample_rate, // media time scale
sample_count*1024, // media duration
language, // language
0, 0); // width, height
If I used it directly in my own code, it usually causes unexpected long duration(exp. 1 minute video shows 40 minutes duration). Hence I modified the code above to
m_nAudioSamples = Audio_Sample_table->GetSampleCount();
AP4_UI64 movie_timescale = 1000;// since video track also uses 1000 as movie_timescale
AP4_UI64 AudioTrackDuration = m_nAudioSamples * movie_timescale;
AP4_UI64 MediaDuration = m_nAudioSamples * movie_timescale;
AudioTrackDuration = AP4_ConvertTime(movie_timescale * m_nAudioSamples, m_sample_rate, movie_timescale);
AP4_Track* track = new AP4_Track(AP4_Track::TYPE_AUDIO,
Audio_Sample_table,
2, //0, // assume video track id = 1, then audio track id = 2
movie_timescale, // movie time scale
AudioTrackDuration, // track duration
m_sample_rate, // media time scale
MediaDuration, // media duration
"und", // language
0, 0); // width, height
Now in this way, the muxer sometimes works, sometimes only have video track, and when probe with ffmpeg, it told me "invalid STSD entries 0".
In order to match video track, what will be the right way to set the following parameters?
movie time scale
track duration
media time scale
media duration
Thanks.
Eric
| Add audio track causes the mp4 file to have "invalid stsd entries 0" | https://api.github.com/repos/axiomatic-systems/Bento4/issues/878/comments | 0 | 2023-07-10T21:49:56Z | 2023-07-13T19:10:16Z | https://github.com/axiomatic-systems/Bento4/issues/878 | 1,797,635,230 | 878 |
[
"axiomatic-systems",
"Bento4"
] | Hi,
There still exists the null pointer reference bug in the latest version (1.6.0-640) of mp4info by the function AP4_DescriptorFinder::Test().
Here is the output of program with address sanitizer attached.
### Bug Report
File:
major brand: isom
minor version: 200
compatible brand: isom
compatible brand: iso2
compatible brand: avc1
compatible brand: mp41
fast start: yes
Movie:
duration: 4637 (media timescale units)
duration: 4637 (ms)
time scale: 1000
fragments: no
Found 2 Tracks
Track 1:
flags: 3 ENABLED IN-MOVIE
id: 1
type: Video
duration: 4600 ms
language: eng
media:
sample count: 138
timescale: 15360
duration: 70656 (media timescale units)
duration: 4600 (ms)
bitrate (computed): 6623656.562 Kbps
display width: 480.000000
display height: 480.000000
frame rate (computed): 30.000
Sample Description 0
Coding: avc1 (H.264)
Codec String: avc1.42C01E
AVC Profile: 66 (Baseline)
AVC Profile Compat: c0
AVC Level: 30
AVC NALU Length Size: 4
AVC SPS: [6742c01eda0783db0110000003001000000303c0f162ea]
AVC PPS: [68ce092c80]
Width: 480
Height: 480
Depth: 24
Track 2:
flags: 3 ENABLED IN-MOVIE
id: 2
type: Audio
duration: 4673 ms
language: eng
media:
sample count: 200
timescale: 44100
duration: 206060 (media timescale units)
duration: 4673 (ms)
bitrate (computed): 28737.402 Kbps
AddressSanitizer:DEADLYSIGNAL
=================================================================
==973829==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x56038ea4c20e bp 0x7ffdee3bfe40 sp 0x7ffdee3bfdc0 T0)
==973829==The signal is caused by a READ memory access.
==973829==Hint: address points to the zero page.
#0 0x56038ea4c20d in AP4_DescriptorFinder::Test(AP4_Descriptor*) const /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4Descriptor.h:92
#1 0x56038ea4c20d in AP4_List<AP4_Descriptor>::Find(AP4_List<AP4_Descriptor>::Item::Finder const&, AP4_Descriptor*&) const /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4List.h:431
#2 0x56038ea4c20d in AP4_EsDescriptor::GetDecoderConfigDescriptor() const /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4EsDescriptor.cpp:207
#3 0x56038e9e0f2e in AP4_MpegSampleDescription::AP4_MpegSampleDescription(unsigned int, AP4_EsdsAtom*) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4SampleDescription.cpp:886
#4 0x56038e9e1566 in AP4_MpegAudioSampleDescription::AP4_MpegAudioSampleDescription(unsigned int, unsigned short, unsigned short, AP4_EsdsAtom*) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4SampleDescription.cpp:1000
#5 0x56038e9e4cd3 in AP4_MpegAudioSampleEntry::ToSampleDescription() /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4SampleEntry.cpp:678
#6 0x56038e9f8a2c in AP4_StsdAtom::GetSampleDescription(unsigned int) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4StsdAtom.cpp:181
#7 0x56038e95544e in ShowTrackInfo_Text /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1351
#8 0x56038e95544e in ShowTrackInfo /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1475
#9 0x56038e955b42 in ShowTracks /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1586
#10 0x56038e9466f4 in main /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1868
#11 0x7fe97e71a082 in __libc_start_main ../csu/libc-start.c:308
#12 0x56038e94a7ed in _start (/home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/build/mp4info+0x447ed)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4Descriptor.h:92 in AP4_DescriptorFinder::Test(AP4_Descriptor*) const
==973829==ABORTING
### Envionment
OS: Ubuntu 20.04.5 LTS x86_64
Release: v1.6.0-640
Program: mp4info
### How to reproduce
$ mp4info poc-file
poc-file is attached.
[poc-file.txt](https://github.com/axiomatic-systems/Bento4/files/11721209/poc-file.txt)
| NULL pointer reference from AP4_DescriptorFinder::Test() in v1.6.0-640 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/875/comments | 1 | 2023-06-12T10:12:34Z | 2024-02-17T17:30:47Z | https://github.com/axiomatic-systems/Bento4/issues/875 | 1,752,398,555 | 875 |
[
"axiomatic-systems",
"Bento4"
] | Hi,
There still exists the null pointer reference bug in the latest version (1.6.0-640) of mp4info by the function AP4_StszAtom::GetSampleSize().
Here is the output of program with address sanitizer attached.
### Bug Report
File:
major brand: isom
minor version: 200
compatible brand: isom
compatible brand: iso2
compatible brand: avc1
compatible brand: mp41
fast start: yes
Movie:
duration: 4960 (media timescale units)
duration: 4960 (ms)
time scale: 1000
fragments: no
Found 1 Tracks
Track 1:
flags: 15 ENABLED IN-MOVIE IN-PREVIEW
id: 1
type: Video
duration: 4960 ms
language: eng
media:
sample count: 16449660
timescale: 25
duration: 124 (media timescale units)
duration: 4960 (ms)
AddressSanitizer:DEADLYSIGNAL
==973817==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x564f30ae87de bp 0x7ffd3baf13c0 sp 0x7ffd3baf13c0 T0)
==973817==The signal is caused by a READ memory access.
==973817==Hint: address points to the zero page.
#0 0x564f30ae87dd in AP4_StszAtom::GetSampleSize(unsigned int, unsigned int&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4StszAtom.cpp:154
#1 0x564f30b193c1 in AP4_AtomSampleTable::GetSample(unsigned int, AP4_Sample&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomSampleTable.cpp:162
#2 0x564f30a3993d in ScanMedia /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1270
#3 0x564f30a422ad in ShowTrackInfo_Text /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1331
#4 0x564f30a422ad in ShowTrackInfo /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1475
#5 0x564f30a42b42 in ShowTracks /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1586
#6 0x564f30a336f4 in main /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1868
#7 0x7fece57fb082 in __libc_start_main ../csu/libc-start.c:308
#8 0x564f30a377ed in _start (/home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/build/mp4info+0x447ed)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4StszAtom.cpp:154 in AP4_StszAtom::GetSampleSize(unsigned int, unsigned int&)
==973817==ABORTING
### Envionment
OS: Ubuntu 20.04.5 LTS x86_64
Release: v1.6.0-640
Program: mp4info
### How to reproduce
$ mp4info poc-file
poc-file is attached.
[poc-file.txt](https://github.com/axiomatic-systems/Bento4/files/11721177/poc-file.txt)
| NULL pointer reference from AP4_StszAtom::GetSampleSize() in v1.6.0-640 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/874/comments | 1 | 2023-06-12T10:08:57Z | 2024-02-17T17:33:31Z | https://github.com/axiomatic-systems/Bento4/issues/874 | 1,752,392,145 | 874 |
[
"axiomatic-systems",
"Bento4"
] | Hi,
There is another out-of-memory bug in the latest version (1.6.0-640) of mp4info because of the function AP4_UrlAtom::AP4_UrlAtom() at Ap4UrlAtom.cpp:71.
Unlike the issue #771, this vunerability happened in the different function AP4_UrlAtom::AP4_UrlAtom().
Here is the output of program with address sanitizer attached.
### Bug Report
=================================================================
==973793==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0xdd000000 bytes
#0 0x7f40c85f9787 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cc:107
#1 0x55f6be8e4ce7 in AP4_UrlAtom::AP4_UrlAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4UrlAtom.cpp:71
#2 0x55f6be8e4ed2 in AP4_UrlAtom::Create(unsigned int, AP4_ByteStream&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4UrlAtom.cpp:47
#3 0x55f6be843fc4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:585
#4 0x55f6be845530 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#5 0x55f6be865836 in AP4_DrefAtom::AP4_DrefAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4DrefAtom.cpp:84
#6 0x55f6be865c13 in AP4_DrefAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4DrefAtom.cpp:50
#7 0x55f6be841d44 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:580
#8 0x55f6be845530 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#9 0x55f6be85241a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:194
#10 0x55f6be8527c3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:139
#11 0x55f6be852ced in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:88
#12 0x55f6be841cf4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:816
#13 0x55f6be845530 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#14 0x55f6be85241a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:194
#15 0x55f6be8527c3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:139
#16 0x55f6be852ced in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:88
#17 0x55f6be841cf4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:816
#18 0x55f6be845530 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#19 0x55f6be85241a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:194
#20 0x55f6be8527c3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:139
#21 0x55f6be852ced in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:88
#22 0x55f6be841cf4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:816
#23 0x55f6be845530 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#24 0x55f6be85241a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:194
#25 0x55f6be8527c3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:139
#26 0x55f6be8e02a8 in AP4_TrakAtom::AP4_TrakAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4TrakAtom.cpp:165
#27 0x55f6be84239f in AP4_TrakAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4TrakAtom.h:58
#28 0x55f6be84239f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:413
#29 0x55f6be845530 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#30 0x55f6be85241a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/targets/Bento4-1.6.0-639_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:194
==973793==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory ../../../../src/libsanitizer/asan/asan_new_delete.cc:107 in operator new[](unsigned long)
==973793==ABORTING
### Envionment
OS: Ubuntu 20.04.5 LTS x86_64
Release: v1.6.0-640
Program: mp4info
### How to reproduce
$ mp4info poc-file
poc-file is attached.
[poc-file.txt](https://github.com/axiomatic-systems/Bento4/files/11721073/poc-file.txt)
| Out-of-memory bug from AP4_UrlAtom::AP4_UrlAtom() in v1.6.0-640 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/873/comments | 1 | 2023-06-12T10:03:27Z | 2024-02-20T02:41:04Z | https://github.com/axiomatic-systems/Bento4/issues/873 | 1,752,379,751 | 873 |
[
"axiomatic-systems",
"Bento4"
] | Hi,
Thanks for fixing the issue #741, but still there is out-of-memory bug in the latest version (1.6.0-640) of multiple programs because of the function AP4_DataBuffer::ReallocateBuffer() at Ap4DataBuffer.cpp:210.
We observed the same bug in mp4info, mp42aac, mp42avc, mp4decrypt, and mp4dump with the same root cause.
Here is the output of program with address sanitizer attached.
### Bug Report
=================================================================
==977537==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x8021ffba bytes
#0 0x7fb17bc08787 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cc:107
#1 0x557daf86f117 in AP4_DataBuffer::ReallocateBuffer(unsigned int) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4DataBuffer.cpp:210
#2 0x557daf86f319 in AP4_DataBuffer::SetDataSize(unsigned int) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4DataBuffer.cpp:151
#3 0x557daf8c68b2 in AP4_AudioSampleEntry::ReadFields(AP4_ByteStream&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4SampleEntry.cpp:502
#4 0x557daf8c5d98 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4SampleEntry.cpp:108
#5 0x557daf8cc2dd in AP4_AudioSampleEntry::AP4_AudioSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4SampleEntry.cpp:420
#6 0x557daf8cc3d2 in AP4_MpegAudioSampleEntry::AP4_MpegAudioSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4SampleEntry.cpp:655
#7 0x557daf8cc3d2 in AP4_Mp4aSampleEntry::AP4_Mp4aSampleEntry(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4SampleEntry.cpp:844
#8 0x557daf850a3b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:286
#9 0x557daf8524e0 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#10 0x557daf8dbac4 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4StsdAtom.cpp:101
#11 0x557daf8dc09b in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4StsdAtom.cpp:57
#12 0x557daf84f9d0 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:458
#13 0x557daf8524e0 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#14 0x557daf85f3ea in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:194
#15 0x557daf85f793 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:139
#16 0x557daf85fcbd in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:88
#17 0x557daf84eca4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:816
#18 0x557daf8524e0 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#19 0x557daf872856 in AP4_DrefAtom::AP4_DrefAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4DrefAtom.cpp:84
#20 0x557daf872c33 in AP4_DrefAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4DrefAtom.cpp:50
#21 0x557daf84ecf4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:580
#22 0x557daf8524e0 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#23 0x557daf85f3ea in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:194
#24 0x557daf85f793 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:139
#25 0x557daf85fcbd in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:88
#26 0x557daf84eca4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:816
#27 0x557daf8524e0 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4AtomFactory.cpp:234
#28 0x557daf85f3ea in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:194
#29 0x557daf85f793 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:139
#30 0x557daf85fcbd in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/targets/Bento4-1.6.0-640_sanitizer/Source/C++/Core/Ap4ContainerAtom.cpp:88
==977537==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory ../../../../src/libsanitizer/asan/asan_new_delete.cc:107 in operator new[](unsigned long)
==977537==ABORTING
### Envionment
OS: Ubuntu 20.04.5 LTS x86_64
Release: v1.6.0-640
Program: mp4info, mp42aac, mp42avc, mp4decrypt, mp4dump
### How to reproduce
$ mp4info, mp4dump} poc-file
or
$ {mp42aac, mp42avc, mp4decrypt} poc-file /dev/null
poc-file is attached.
[poc-file.txt](https://github.com/axiomatic-systems/Bento4/files/11720958/poc-file.txt) | Out-of-memory bug from AP4_DataBuffer::ReallocateBuffer() in multiple programs (v1.6.0-640) | https://api.github.com/repos/axiomatic-systems/Bento4/issues/872/comments | 2 | 2023-06-12T09:44:14Z | 2024-02-17T17:35:35Z | https://github.com/axiomatic-systems/Bento4/issues/872 | 1,752,341,840 | 872 |
[
"axiomatic-systems",
"Bento4"
] | When specifying multiple custom tags, only the last custom tag is applied.
The namespace seems to be immaterial -- only the last custom tag is applied.
This can be seen with the command line tool, but is also the case using the API.
```
bll-g7:bll$ LD_LIBRARY_PATH=../plocal/lib ../plocal/bin/mp4tag \
--set $'\xa9alb:S:album' --set $'\xa9ART:S:artist' \
--set BDJ4/aaa:S:aaa --set BDJ4/bbb:S:bbb \
../test-music/010-tango-m4a.m4a out.m4a
bll-g7:bll$ LD_LIBRARY_PATH=../plocal/lib ../plocal/bin/mp4tag out.m4a
Tool:[S] Lavf58.45.100
AlbumArtist:[S] 010-albartist
GenreName:[S] Rock
Name:[S] 010-tango-m4a
Album:[S] album
Artist:[S] artist
BDJ4/bbb:[S] bbb
```
| metadata: multiple custom tags are not processed properly | https://api.github.com/repos/axiomatic-systems/Bento4/issues/871/comments | 0 | 2023-06-11T20:04:39Z | 2023-06-11T20:04:39Z | https://github.com/axiomatic-systems/Bento4/issues/871 | 1,751,585,336 | 871 |
[
"axiomatic-systems",
"Bento4"
] | mp4dash.bat C:\temp\video.mp4 C:\temp\audio.mp4 [+format=webvtt,+language=en,+language_name=en]C:\temp\test.vtt --hls
Incorrectly created a problem with the media.m3u8 subtitles, the player does not work because of the subtitles.
#
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:7694
#EXTINF:7694,
test.vtt
#EXT-X-ENDLIST
There should be a segment there, I don't see it.
#
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:5
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:4.000,
s-en-s1.vtt
#EXTINF:4.000,
s-en-s2.vtt
#EXTINF:4.000,
s-en-s3.vtt
#EXTINF:4.000,
s-en-s4.vtt
#EXTINF:4.000,
s-en-s5.vtt
#EXTINF:4.000,
s-en-s6.vtt
#EXTINF:4.000,
s-en-s7.vtt
#EXTINF:4.000,
s-en-s8.vtt
#EXTINF:4.000,
s-en-s9.vtt
#EXTINF:4.000,
s-en-s10.vtt
#EXTINF:4.000,
s-en-s11.vtt
#EXTINF:4.000,
s-en-s12.vtt
#EXTINF:4.000,
s-en-s13.vtt
#EXTINF:4.000,
s-en-s14.vtt
#EXTINF:4.000,
s-en-s15.vtt
#EXTINF:4.000,
s-en-s16.vtt
#EXT-X-ENDLIST
Should be working fine.
| subtitles vtt manifest problems media.m3u8 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/870/comments | 2 | 2023-06-10T17:35:46Z | 2023-06-11T03:59:10Z | https://github.com/axiomatic-systems/Bento4/issues/870 | 1,751,052,916 | 870 |
[
"axiomatic-systems",
"Bento4"
] | python3: can't open file '/data/data/com.termux/files/usr/bin/../utils/mp4-dash.py': [Errno 2] No such file or directory
Y am I getting this error? | python3: can't open file '/data/data/com.termux/files/usr/bin/../utils/mp4-dash.py': [Errno 2] No such file or directory | https://api.github.com/repos/axiomatic-systems/Bento4/issues/869/comments | 1 | 2023-06-10T05:17:06Z | 2023-06-10T19:53:00Z | https://github.com/axiomatic-systems/Bento4/issues/869 | 1,750,804,020 | 869 |
[
"axiomatic-systems",
"Bento4"
] | The 'keyw' atom, AP4_ATOM_TYPE_KYWD is not processed and ends up being silently ignored.
Output from python-mutagen:
```
keyw=tag4 TAG5 spaces bpm ss
``` | metadata: keyw is not processed | https://api.github.com/repos/axiomatic-systems/Bento4/issues/868/comments | 2 | 2023-06-08T16:49:02Z | 2023-06-10T21:50:09Z | https://github.com/axiomatic-systems/Bento4/issues/868 | 1,748,313,580 | 868 |
[
"axiomatic-systems",
"Bento4"
] | C:\Encoder\Bento4_1.6.0.640\bin\mp4dash.bat C:\temp\video_1000.mp4 C:\temp\video_2000.mp4 --hls --force -o C:\temp\test
Parsing media file 1: C:\temp\video_1000.mp4
Parsing media file 2: C:\temp\video_2000.mp4
WARNING: video duration mismatch between "File 2#1" and "File 1#1"
ERROR: video tracks are not aligned ("File 2#1" differs from File 1#1)
The problem is an error, fix it before updating. | video_1000.mp4 and video_2000.mp4 ERROR | https://api.github.com/repos/axiomatic-systems/Bento4/issues/867/comments | 2 | 2023-06-06T09:02:15Z | 2023-10-10T04:22:03Z | https://github.com/axiomatic-systems/Bento4/issues/867 | 1,743,416,742 | 867 |
[
"axiomatic-systems",
"Bento4"
] | Good day!
I wanted to ask you to make a new one mp4mux.exe , commands cover.png, cover.jpg and subtitles ttxt, webvtt. you can do?
I am ready to make a donation to you. I have been using MP4Box for a long time, and then through mp4fragment.exe and mp4dash.bat so because I don't use mp4mux you don't have enough, cover no, subtitles no, brand no. | mp4mux.exe | https://api.github.com/repos/axiomatic-systems/Bento4/issues/866/comments | 2 | 2023-06-03T15:08:23Z | 2023-06-06T07:48:08Z | https://github.com/axiomatic-systems/Bento4/issues/866 | 1,739,609,911 | 866 |
[
"axiomatic-systems",
"Bento4"
] | When will it be updated? | #EXT-X-BITRATE | https://api.github.com/repos/axiomatic-systems/Bento4/issues/864/comments | 1 | 2023-06-01T08:38:26Z | 2023-06-10T19:54:24Z | https://github.com/axiomatic-systems/Bento4/issues/864 | 1,735,783,491 | 864 |
[
"axiomatic-systems",
"Bento4"
] | <HTML><HEAD></HEAD>
<BODY>
<TABLE
style="BORDER-TOP: navy 1px solid; BORDER-RIGHT: navy 1px solid; BORDER-BOTTOM: navy 1px solid; BORDER-LEFT: navy 1px solid"
cellSpacing=2 cellPadding=1 width="100%" border=0>
<TBODY><!--StartFragment--><TR>
<TD width=150>
<H2>Video</H2></TD></TR>
<TR>
<TD><I>ID :</I></TD>
<TD colSpan=3>1</TD></TR>
<TR>
<TD><I>Format :</I></TD>
<TD colSpan=3>HEVC</TD></TR>
<TR>
<TD><I>Format/Info :</I></TD>
<TD colSpan=3>High Efficiency Video Coding</TD></TR>
<TR>
<TD><I>Format profile :</I></TD>
<TD colSpan=3>Main 10@L5@High</TD></TR>
<TR>
<TD><I>HDR format :</I></TD>
<TD colSpan=3>SMPTE ST 2086, HDR10 compatible</TD></TR>
<TR>
<TD><I>Codec ID :</I></TD>
<TD colSpan=3>hvc1</TD></TR>
<TR>
<TD><I>Codec ID/Info :</I></TD>
<TD colSpan=3>High Efficiency Video Coding</TD></TR>
<TR>
<TD><I>Duration :</I></TD>
<TD colSpan=3>1 h 47 min</TD></TR>
<TR>
<TD><I>Bit rate :</I></TD>
<TD colSpan=3>22.4 Mb/s</TD></TR>
<TR>
<TD><I>Width :</I></TD>
<TD colSpan=3>3 840 pixels</TD></TR>
<TR>
<TD><I>Height :</I></TD>
<TD colSpan=3>1 632 pixels</TD></TR>
<TR>
<TD><I>Display aspect ratio :</I></TD>
<TD colSpan=3>2.35:1</TD></TR>
<TR>
<TD><I>Frame rate mode :</I></TD>
<TD colSpan=3>Constant</TD></TR>
<TR>
<TD><I>Frame rate :</I></TD>
<TD colSpan=3>23.976 (24000/1001) FPS</TD></TR>
<TR>
<TD><I>Color space :</I></TD>
<TD colSpan=3>YUV</TD></TR>
<TR>
<TD><I>Chroma subsampling :</I></TD>
<TD colSpan=3>4:2:0 (Type 2)</TD></TR>
<TR>
<TD><I>Bit depth :</I></TD>
<TD colSpan=3>10 bits</TD></TR>
<TR>
<TD><I>Bits/(Pixel*Frame) :</I></TD>
<TD colSpan=3>0.149</TD></TR>
<TR>
<TD><I>Stream size :</I></TD>
<TD colSpan=3>16.8 GiB (100%)</TD></TR>
<TR>
<TD><I>Color range :</I></TD>
<TD colSpan=3>Limited</TD></TR>
<TR>
<TD><I>Color primaries :</I></TD>
<TD colSpan=3>BT.2020</TD></TR>
<TR>
<TD><I>Transfer characteristics :</I></TD>
<TD colSpan=3>PQ</TD></TR>
<TR>
<TD><I>Matrix coefficients :</I></TD>
<TD colSpan=3>BT.2020 non-constant</TD></TR>
<TR>
<TD><I>Mastering display color primaries :</I></TD>
<TD colSpan=3>Display P3</TD></TR>
<TR>
<TD><I>Mastering display luminance :</I></TD>
<TD colSpan=3>min: 0.0050 cd/m2, max: 1000 cd/m2</TD></TR>
<TR>
<TD><I>Maximum Content Light Level :</I></TD>
<TD colSpan=3>997 cd/m2</TD></TR>
<TR>
<TD><I>Maximum Frame-Average Light Level :</I></TD>
<TD colSpan=3>200 cd/m2</TD></TR>
<TR>
<TD><I>Codec configuration box :</I></TD>
<TD colSpan=3>hvcC</TD></TR><!--EndFragment--></TBODY></TABLE></BODY></HTML>
Incorrect VIDEO-RANGE=SDR, should be PQ. | VIDEO-RANGE | https://api.github.com/repos/axiomatic-systems/Bento4/issues/863/comments | 1 | 2023-05-30T03:54:47Z | 2024-04-10T13:49:48Z | https://github.com/axiomatic-systems/Bento4/issues/863 | 1,731,464,435 | 863 |
[
"axiomatic-systems",
"Bento4"
] | null | master.m3u8, iframes.m3u8 and media.m3u8 URL | https://api.github.com/repos/axiomatic-systems/Bento4/issues/862/comments | 3 | 2023-05-27T10:38:30Z | 2023-06-10T09:14:17Z | https://github.com/axiomatic-systems/Bento4/issues/862 | 1,728,638,672 | 862 |
[
"axiomatic-systems",
"Bento4"
] | Good afternoon! Subtitles are one en_full.vtt after creation, media.m3u8 is fine, and when 2 or 3 en_full.vtt, en_sdh.vtt and en_comment.vtt after creation, one is obtained in the media.m3u8 file - there is en_full.vtt, and there are still 2 en_sdh.vtt and en_comment.vtt yes files, media.m3u8 no file. Windows 10, Version 1.6.0-640.
[+format=webvtt,+language=en,+language_name=en]"C:\temp\JACK_THE_GIANT_SLAYER_2013_BD.en_Full.vtt" media.m3u8 yes
[+format=webvtt,+language=en,+language_name=en]"C:\temp\JACK_THE_GIANT_SLAYER_2013_BD.en_SDH.vtt" media.m3u8 no
[+format=webvtt,+language=en,+language_name=en]"C:\temp\JACK_THE_GIANT_SLAYER_2013_BD.en_Comment.vtt" media.m3u8 no | SUBTITLES problem | https://api.github.com/repos/axiomatic-systems/Bento4/issues/861/comments | 3 | 2023-05-27T08:02:56Z | 2023-06-10T19:55:43Z | https://github.com/axiomatic-systems/Bento4/issues/861 | 1,728,529,470 | 861 |
[
"axiomatic-systems",
"Bento4"
] | Hi, I'm not sure if this is the right place to ask this question, but I would appreciate if anyone could answer my questions.
https://github.com/glomatico/gamdl/blob/main/README.md
I'm using a apple downloader script above, it uses aria2c.exe, mp4box.exe and mp4decrypt.exe.
I compared the downloaded song from this script to an itunesmatch downloaded version both from the same link, however the audio stream did not match. So I was wondering that did it convert the song after decrypting it? I'm not exactly sure how it works.

| does it convert lossy file to lossy in its output? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/860/comments | 2 | 2023-05-26T07:04:16Z | 2023-05-29T09:24:50Z | https://github.com/axiomatic-systems/Bento4/issues/860 | 1,727,026,194 | 860 |
[
"axiomatic-systems",
"Bento4"
] | <HTML><HEAD></HEAD>
<BODY>
<TABLE
style="BORDER-TOP: navy 1px solid; BORDER-RIGHT: navy 1px solid; BORDER-BOTTOM: navy 1px solid; BORDER-LEFT: navy 1px solid"
cellSpacing=2 cellPadding=1 width="100%" border=0>
<TBODY><!--StartFragment--><TR>
<TD width=150>
<H2>Audio</H2></TD></TR>
<TR>
<TD><I>ID :</I></TD>
<TD colSpan=3>1</TD></TR>
<TR>
<TD><I>Format :</I></TD>
<TD colSpan=3>AAC LC</TD></TR>
<TR>
<TD><I>Format/Info :</I></TD>
<TD colSpan=3>Advanced Audio Codec Low Complexity</TD></TR>
<TR>
<TD><I>Codec ID :</I></TD>
<TD colSpan=3>mp4a-40-2</TD></TR>
<TR>
<TD><I>Duration :</I></TD>
<TD colSpan=3>1 h 52 min</TD></TR>
<TR>
<TD><I>Bit rate mode :</I></TD>
<TD colSpan=3>Constant</TD></TR>
<TR>
<TD><I>Nominal bit rate :</I></TD>
<TD colSpan=3>128 kb/s</TD></TR>
<TR>
<TD><I>Channel(s) :</I></TD>
<TD colSpan=3>8 channels</TD></TR>
<TR>
<TD><I>Channel layout :</I></TD>
<TD colSpan=3>C L R Ls Rs Lw Rw LFE</TD></TR>
<TR>
<TD><I>Sampling rate :</I></TD>
<TD colSpan=3>48.0 kHz</TD></TR>
<TR>
<TD><I>Frame rate :</I></TD>
<TD colSpan=3>46.875 FPS (1024 SPF)</TD></TR>
<TR>
<TD><I>Compression mode :</I></TD>
<TD colSpan=3>Lossy</TD></TR>
<TR>
<TD><I>Language :</I></TD>
<TD colSpan=3>English</TD></TR><!--EndFragment--></TBODY></TABLE></BODY></HTML>
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio/mp4a.40.2",LANGUAGE="en",NAME="English 7.1 | Original",AUTOSELECT=YES,DEFAULT=NO,CHANNELS="7",URI="audio/en/mp4a.40.2/media.m3u8"
СHANNELS="7" wrong, should be on 8. | HLS AUDIO AAC 7.1 CHANNELS 7 mistake | https://api.github.com/repos/axiomatic-systems/Bento4/issues/859/comments | 3 | 2023-05-22T17:42:29Z | 2023-05-29T02:00:53Z | https://github.com/axiomatic-systems/Bento4/issues/859 | 1,720,142,854 | 859 |
[
"axiomatic-systems",
"Bento4"
] | I have pre encrypted video (using mp4encrypt)
then I pass it to mp4dash but the MPD does not include any KID when I use --clearkey, however when I set --widevine the KID appeared | mp4dash not working with encrypted input and --clearkey | https://api.github.com/repos/axiomatic-systems/Bento4/issues/856/comments | 1 | 2023-05-02T10:15:26Z | 2023-05-29T02:22:37Z | https://github.com/axiomatic-systems/Bento4/issues/856 | 1,692,151,181 | 856 |
[
"axiomatic-systems",
"Bento4"
] | mp4info:
```json
{
"file": {
"major_brand": "isom",
"minor_version": 512,
"compatible_brands": [
"isom",
"iso2",
"avc1",
"mp41"
],
"fast_start": false
},
"movie": {
"duration_ms": 10100,
"duration": 10100,
"time_scale": 1000,
"fragments": false
},
"tracks": [
{
"flags": 3,
"flag_names": [
"ENABLED",
"IN-MOVIE"
],
"id": 1,
"type": "Video",
"duration_ms": 10100,
"language": "eng",
"media": {
"sample_count": 226,
"timescale": 25000,
"duration": 252500,
"duration_ms": 10100,
"bitrate": 9048.6
},
"display_width": 1920,
"display_height": 1080,
"frame_rate": 22.376,
"sample_descriptions": [
{
"coding": "avc1",
"coding_name": "H.264",
"codecs_string": "avc1.640029",
"avc_profile": 100,
"avc_profile_name": "High",
"avc_profile_compat": 0,
"avc_level": 41,
"avc_nalu_length_size": 4,
"avc_sps": [
"67640029ac2ca501e0111f7350101014000003000400000300ca10"
],
"avc_pps": [
"68e881135250"
],
"width": 1920,
"height": 1080,
"depth": 24
}
]
},
{
"flags": 3,
"flag_names": [
"ENABLED",
"IN-MOVIE"
],
"id": 2,
"type": "Audio",
"duration_ms": 9984,
"language": "eng",
"media": {
"sample_count": 471,
"timescale": 48000,
"duration": 479232,
"duration_ms": 9984,
"bitrate": 129.325
},
"sample_descriptions": [
{
"coding": "mp4a",
"coding_name": "MPEG-4 Audio",
"codecs_string": "mp4a.40.2",
"stream_type": 5,
"stream_type_name": "Audio",
"object_type": 64,
"object_type_name": "MPEG-4 Audio",
"max_bitrate": 128757,
"average_bitrate": 128757,
"buffer_size": 0,
"decoder_info": "1190",
"mpeg_4_audio_object_type": 2,
"mpeg_4_audio_object_type_name": "AAC Low Complexity",
"mpeg_4_audio_decoder_config": {
"sampling_frequency": 48000,
"channels": 2
},
"sample_rate": 48000,
"sample_size": 16,
"channels": 2
}
]
}
]
}
```
Can anyone help you find out why?
I've already checked avc_level, avc_profile_name and bitrate | [SOS]I have an H.264 video that won't play on iOS | https://api.github.com/repos/axiomatic-systems/Bento4/issues/854/comments | 0 | 2023-04-13T06:35:33Z | 2023-04-13T06:35:33Z | https://github.com/axiomatic-systems/Bento4/issues/854 | 1,665,808,772 | 854 |
[
"axiomatic-systems",
"Bento4"
] | SUMMARY: AddressSanitizer: heap-buffer-overflow in Source/C++/Core/Ap4Dac4Atom.cpp:367
- Version
```
$ ./mp42aac
MP4 To AAC File Converter - Version 1.0
(Bento4 Version 1.6.0.0)
(c) 2002-2008 Axiomatic Systems, LLC
```
- Platform
```
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ clang --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ uname -r
4.15.0-142-generic
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
```
- Steps to reproduce
```
$ 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
$ ./mp42aac poc000535 /dev/null
```
- ASAN OUTPUT
```
$ ./mp42aac poc000535 /dev/null
=================================================================
==130073==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62b000006500 at pc 0x00000059f602 bp 0x7ffe95508810 sp 0x7ffe95508800
WRITE of size 1 at 0x62b000006500 thread T0
#0 0x59f601 in AP4_Dac4Atom::AP4_Dac4Atom(unsigned int, unsigned char const*) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:367
#1 0x59f95d in AP4_Dac4Atom::Create(unsigned int, AP4_ByteStream&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:58
#2 0x508f8f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:776
#3 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#4 0x578438 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#5 0x47f751 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:115
#6 0x47f751 in AP4_AudioSampleEntry::AP4_AudioSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:420
#7 0x47f751 in AP4_Ac4SampleEntry::AP4_Ac4SampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:801
#8 0x506055 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:342
#9 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#10 0x48f0a0 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:101
#11 0x490d40 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:57
#12 0x509ece in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:458
#13 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#14 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#15 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#16 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#17 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#18 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#19 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#20 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#21 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#22 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#23 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#24 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#25 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#26 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#27 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#28 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#29 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#30 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#31 0x4988d2 in AP4_TrakAtom::AP4_TrakAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4TrakAtom.cpp:165
#32 0x509209 in AP4_TrakAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4TrakAtom.h:58
#33 0x509209 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:413
#34 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#35 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#36 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#37 0x41f62c in AP4_MoovAtom::AP4_MoovAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4MoovAtom.cpp:80
#38 0x506e10 in AP4_MoovAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4MoovAtom.h:56
#39 0x506e10 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:393
#40 0x50d2c8 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#41 0x50d2c8 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:154
#42 0x419427 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4File.cpp:104
#43 0x419427 in AP4_File::AP4_File(AP4_ByteStream&, bool) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4File.cpp:78
#44 0x40408b in main /workdir/wqh/Bento4-master/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:250
#45 0x7f72ca33283f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#46 0x408448 in _start (/d/p/aflasan/mp42aac-latest+0x408448)
0x62b000006500 is located 0 bytes to the right of 25344-byte region [0x62b000000200,0x62b000006500)
allocated by thread T0 here:
#0 0x7f72cb0166b2 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x996b2)
#1 0x59b86d in AP4_Dac4Atom::AP4_Dac4Atom(unsigned int, unsigned char const*) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:196
SUMMARY: AddressSanitizer: heap-buffer-overflow /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:367 AP4_Dac4Atom::AP4_Dac4Atom(unsigned int, unsigned char const*)
Shadow bytes around the buggy address:
0x0c567fff8c50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c567fff8c60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c567fff8c70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c567fff8c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c567fff8c90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c567fff8ca0:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c567fff8cb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c567fff8cc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c567fff8cd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c567fff8ce0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c567fff8cf0: 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==130073==ABORTING
```
poc:
[poc000535.zip](https://github.com/axiomatic-systems/Bento4/files/11217547/poc000535.zip)
Thanks! | Heap-buffer-overflow with ASAN at Ap4Dac4Atom.cpp:367 in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/853/comments | 0 | 2023-04-13T02:20:46Z | 2023-05-29T02:24:16Z | https://github.com/axiomatic-systems/Bento4/issues/853 | 1,665,568,996 | 853 |
[
"axiomatic-systems",
"Bento4"
] | SUMMARY: AddressSanitizer: SEGV on unknown address in Source/C++/Core/Ap4Dac4Atom.cpp:418
- Version
```
$ ./mp42aac
MP4 To AAC File Converter - Version 1.0
(Bento4 Version 1.6.0.0)
(c) 2002-2008 Axiomatic Systems, LLC
```
- Platform
```
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ clang --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ uname -r
4.15.0-142-generic
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
```
- Steps to reproduce
```
$ 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
$ ./mp42aac poc000492 /dev/null
```
- ASAN OUTPUT
```
$ ./mp42aac poc000492 /dev/null
ERROR: unsupported sample type
ASAN:SIGSEGV
=================================================================
==130371==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000005a04cf bp 0x000000000948 sp 0x7ffe4d376f50 T0)
#0 0x5a04ce in AP4_Dac4Atom::~AP4_Dac4Atom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:418
#1 0x5a04ce in AP4_Dac4Atom::~AP4_Dac4Atom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:424
#2 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#3 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#4 0x48615b in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#5 0x48615b in AP4_SampleEntry::~AP4_SampleEntry() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.h:63
#6 0x48615b in AP4_AudioSampleEntry::~AP4_AudioSampleEntry() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.h:124
#7 0x48615b in AP4_Ac4SampleEntry::~AP4_Ac4SampleEntry() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.h:312
#8 0x48615b in AP4_Ac4SampleEntry::~AP4_Ac4SampleEntry() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.h:312
#9 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#10 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#11 0x491341 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#12 0x491341 in AP4_StsdAtom::~AP4_StsdAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:124
#13 0x491790 in AP4_StsdAtom::~AP4_StsdAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:129
#14 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#15 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#16 0x578d13 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#17 0x578d13 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#18 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#19 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#20 0x578d13 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#21 0x578d13 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#22 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#23 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#24 0x578d13 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#25 0x578d13 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#26 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#27 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#28 0x49bc5b in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#29 0x49bc5b in AP4_TrakAtom::~AP4_TrakAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4TrakAtom.h:49
#30 0x49bc5b in AP4_TrakAtom::~AP4_TrakAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4TrakAtom.h:49
#31 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#32 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#33 0x420bb8 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#34 0x420bb8 in AP4_MoovAtom::~AP4_MoovAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4MoovAtom.h:47
#35 0x420bb8 in AP4_MoovAtom::~AP4_MoovAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4MoovAtom.h:47
#36 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#37 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#38 0x4866fb in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#39 0x4866fb in AP4_SampleEntry::~AP4_SampleEntry() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.h:63
#40 0x4866fb in AP4_AudioSampleEntry::~AP4_AudioSampleEntry() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.h:124
#41 0x4866fb in AP4_Ac3SampleEntry::~AP4_Ac3SampleEntry() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.h:271
#42 0x4866fb in AP4_Ac3SampleEntry::~AP4_Ac3SampleEntry() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.h:271
#43 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#44 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#45 0x491341 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#46 0x491341 in AP4_StsdAtom::~AP4_StsdAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:124
#47 0x491790 in AP4_StsdAtom::~AP4_StsdAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:129
#48 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#49 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#50 0x578d13 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#51 0x578d13 in AP4_ContainerAtom::~AP4_ContainerAtom() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.h:48
#52 0x4e64b7 in AP4_List<AP4_Atom>::DeleteReferences() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4List.h:476
#53 0x4e64b7 in AP4_AtomParent::~AP4_AtomParent() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Atom.cpp:516
#54 0x417ee3 in AP4_File::~AP4_File() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4File.cpp:84
#55 0x417ee3 in AP4_File::~AP4_File() /workdir/wqh/Bento4-master/Source/C++/Core/Ap4File.cpp:88
#56 0x404363 in main /workdir/wqh/Bento4-master/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:303
#57 0x7fb64a6e683f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#58 0x408448 in _start (/d/p/aflasan/mp42aac-latest+0x408448)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:418 AP4_Dac4Atom::~AP4_Dac4Atom()
==130371==ABORTING
```
poc:
[poc000492.zip](https://github.com/axiomatic-systems/Bento4/files/11217542/poc000492.zip)
Thanks! | SEGV with ASAN at Ap4Dac4Atom.cpp:418 in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/852/comments | 0 | 2023-04-13T02:18:14Z | 2023-05-29T02:24:16Z | https://github.com/axiomatic-systems/Bento4/issues/852 | 1,665,566,676 | 852 |
[
"axiomatic-systems",
"Bento4"
] | SUMMARY: AddressSanitizer: heap-buffer-overflow in Source/C++/Core/Ap4Utils.cpp:564
- Version
```
$ ./mp42aac
MP4 To AAC File Converter - Version 1.0
(Bento4 Version 1.6.0.0)
(c) 2002-2008 Axiomatic Systems, LLC
```
- Platform
```
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ clang --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ uname -r
4.15.0-142-generic
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
```
- Steps to reproduce
```
$ 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
$ ./mp42aac poc000476 /dev/null
```
- ASAN OUTPUT
```
$ ./mp42aac poc000476 /dev/null
=================================================================
==129953==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x611000009c38 at pc 0x0000004a3a41 bp 0x7fffcb880170 sp 0x7fffcb880160
READ of size 4 at 0x611000009c38 thread T0
#0 0x4a3a40 in AP4_BitReader::SkipBits(unsigned int) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Utils.cpp:564
#1 0x59bd9f in AP4_Dac4Atom::AP4_Dac4Atom(unsigned int, unsigned char const*) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:396
#2 0x59f95d in AP4_Dac4Atom::Create(unsigned int, AP4_ByteStream&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:58
#3 0x508f8f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:776
#4 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#5 0x578438 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#6 0x47f751 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:115
#7 0x47f751 in AP4_AudioSampleEntry::AP4_AudioSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:420
#8 0x47f751 in AP4_Ac4SampleEntry::AP4_Ac4SampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:801
#9 0x506055 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:342
#10 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#11 0x48f0a0 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:101
#12 0x490d40 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:57
#13 0x509ece in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:458
#14 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#15 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#16 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#17 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#18 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#19 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#20 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#21 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#22 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#23 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#24 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#25 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#26 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#27 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#28 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#29 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#30 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#31 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#32 0x4988d2 in AP4_TrakAtom::AP4_TrakAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4TrakAtom.cpp:165
#33 0x509209 in AP4_TrakAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4TrakAtom.h:58
#34 0x509209 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:413
#35 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#36 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#37 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#38 0x41f62c in AP4_MoovAtom::AP4_MoovAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4MoovAtom.cpp:80
#39 0x506e10 in AP4_MoovAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4MoovAtom.h:56
#40 0x506e10 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:393
#41 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#42 0x578438 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#43 0x4809f9 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:115
#44 0x4809f9 in AP4_AudioSampleEntry::AP4_AudioSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:420
#45 0x4809f9 in AP4_Ac3SampleEntry::AP4_Ac3SampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:707
#46 0x50845d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:334
#47 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#48 0x48f0a0 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:101
#49 0x490d40 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:57
#50 0x509ece in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:458
#51 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#52 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#53 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#54 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#55 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#56 0x50d2c8 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#57 0x50d2c8 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:154
#58 0x419427 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4File.cpp:104
#59 0x419427 in AP4_File::AP4_File(AP4_ByteStream&, bool) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4File.cpp:78
#60 0x40408b in main /workdir/wqh/Bento4-master/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:250
#61 0x7f6fa405d83f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#62 0x408448 in _start (/d/p/aflasan/mp42aac-latest+0x408448)
0x611000009c38 is located 0 bytes to the right of 248-byte region [0x611000009b40,0x611000009c38)
allocated by thread T0 here:
#0 0x7f6fa4d416b2 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x996b2)
#1 0x415936 in AP4_DataBuffer::ReallocateBuffer(unsigned int) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4DataBuffer.cpp:210
#2 0x415936 in AP4_DataBuffer::SetBufferSize(unsigned int) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4DataBuffer.cpp:136
SUMMARY: AddressSanitizer: heap-buffer-overflow /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Utils.cpp:564 AP4_BitReader::SkipBits(unsigned int)
Shadow bytes around the buggy address:
0x0c227fff9330: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c227fff9340: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c227fff9350: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c227fff9360: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
0x0c227fff9370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c227fff9380: 00 00 00 00 00 00 00[fa]fa fa fa fa fa fa fa fa
0x0c227fff9390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c227fff93a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa
0x0c227fff93b0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
0x0c227fff93c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c227fff93d0: 00 00 00 00 00 00 00 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==129953==ABORTING
```
poc:
[poc000476.zip](https://github.com/axiomatic-systems/Bento4/files/11217529/poc000476.zip)
Thanks! | Heap-buffer-overflow with ASAN at Ap4Utils.cpp:564 in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/851/comments | 0 | 2023-04-13T02:15:18Z | 2023-05-29T02:24:15Z | https://github.com/axiomatic-systems/Bento4/issues/851 | 1,665,563,851 | 851 |
[
"axiomatic-systems",
"Bento4"
] | SUMMARY: AddressSanitizer: heap-buffer-overflow in Source/C++/Core/Ap4Utils.cpp:471
- Version
```
$ ./mp42aac
MP4 To AAC File Converter - Version 1.0
(Bento4 Version 1.6.0.0)
(c) 2002-2008 Axiomatic Systems, LLC
```
- Platform
```
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ clang --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ uname -r
4.15.0-142-generic
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
```
- Steps to reproduce
```
$ 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
$ ./mp42aac poc472 /dev/null
```
- ASAN OUTPUT
```
$ ./mp42aac poc472 /dev/null
=================================================================
==129540==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x611000009c38 at pc 0x0000004a25c1 bp 0x7ffdd56e5c30 sp 0x7ffdd56e5c20
READ of size 4 at 0x611000009c38 thread T0
#0 0x4a25c0 in AP4_BitReader::ReadBits(unsigned int) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Utils.cpp:471
#1 0x59c984 in AP4_Dac4Atom::AP4_Dac4Atom(unsigned int, unsigned char const*) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:367
#2 0x59f95d in AP4_Dac4Atom::Create(unsigned int, AP4_ByteStream&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Dac4Atom.cpp:58
#3 0x508f8f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:776
#4 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#5 0x578438 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#6 0x47f751 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:115
#7 0x47f751 in AP4_AudioSampleEntry::AP4_AudioSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:420
#8 0x47f751 in AP4_Ac4SampleEntry::AP4_Ac4SampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:801
#9 0x506055 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:342
#10 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#11 0x48f0a0 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:101
#12 0x490d40 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:57
#13 0x509ece in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:458
#14 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#15 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#16 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#17 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#18 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#19 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#20 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#21 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#22 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#23 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#24 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#25 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#26 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#27 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#28 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#29 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#30 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#31 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#32 0x4988d2 in AP4_TrakAtom::AP4_TrakAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4TrakAtom.cpp:165
#33 0x509209 in AP4_TrakAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4TrakAtom.h:58
#34 0x509209 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:413
#35 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#36 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#37 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#38 0x41f62c in AP4_MoovAtom::AP4_MoovAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4MoovAtom.cpp:80
#39 0x506e10 in AP4_MoovAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4MoovAtom.h:56
#40 0x506e10 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:393
#41 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#42 0x578438 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#43 0x4809f9 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:115
#44 0x4809f9 in AP4_AudioSampleEntry::AP4_AudioSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:420
#45 0x4809f9 in AP4_Ac3SampleEntry::AP4_Ac3SampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:707
#46 0x50845d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:334
#47 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#48 0x48f0a0 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:101
#49 0x490d40 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4StsdAtom.cpp:57
#50 0x509ece in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:458
#51 0x50e356 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#52 0x5763a2 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194
#53 0x5763a2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139
#54 0x577196 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88
#55 0x50727b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816
#56 0x50d2c8 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234
#57 0x50d2c8 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:154
#58 0x419427 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4File.cpp:104
#59 0x419427 in AP4_File::AP4_File(AP4_ByteStream&, bool) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4File.cpp:78
#60 0x40408b in main /workdir/wqh/Bento4-master/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:250
#61 0x7f958606983f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#62 0x408448 in _start (/d/p/aflasan/mp42aac-latest+0x408448)
0x611000009c38 is located 0 bytes to the right of 248-byte region [0x611000009b40,0x611000009c38)
allocated by thread T0 here:
#0 0x7f9586d4d6b2 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x996b2)
#1 0x415936 in AP4_DataBuffer::ReallocateBuffer(unsigned int) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4DataBuffer.cpp:210
#2 0x415936 in AP4_DataBuffer::SetBufferSize(unsigned int) /workdir/wqh/Bento4-master/Source/C++/Core/Ap4DataBuffer.cpp:136
SUMMARY: AddressSanitizer: heap-buffer-overflow /workdir/wqh/Bento4-master/Source/C++/Core/Ap4Utils.cpp:471 AP4_BitReader::ReadBits(unsigned int)
Shadow bytes around the buggy address:
0x0c227fff9330: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c227fff9340: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c227fff9350: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c227fff9360: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
0x0c227fff9370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c227fff9380: 00 00 00 00 00 00 00[fa]fa fa fa fa fa fa fa fa
0x0c227fff9390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c227fff93a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa
0x0c227fff93b0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
0x0c227fff93c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c227fff93d0: 00 00 00 00 00 00 00 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==129540==ABORTING
```
poc:
[poc472.zip](https://github.com/axiomatic-systems/Bento4/files/11217517/poc472.zip)
Thanks! | Heap-buffer-overflow with ASAN at Ap4Utils.cpp:471 in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/850/comments | 0 | 2023-04-13T02:09:43Z | 2023-05-29T02:24:15Z | https://github.com/axiomatic-systems/Bento4/issues/850 | 1,665,560,259 | 850 |
[
"axiomatic-systems",
"Bento4"
] | I recently had a need to mux an AV1 stream to MP4.
In order to create `AP4_Av1SampleDescription`, the information included in the sequence header should be used, but we confirmed that `AP4_Av1FrameParser` does not exist.
In order to solve the problem we are facing right now, we are directly parsing and using the sequence header.
However, I want to maintain a consistent source code by using `AP4_Av1FrameParser` included in libap4 like `AP4_AvcFrameParser`.
I hope you will review it positively. Thank. | Could you please add `AP4_Av1FrameParser`? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/849/comments | 2 | 2023-04-11T01:13:24Z | 2023-06-02T03:11:10Z | https://github.com/axiomatic-systems/Bento4/issues/849 | 1,661,621,042 | 849 |
[
"axiomatic-systems",
"Bento4"
] | Not sure what version #667 is, but I have the same issue running on version 1.6.0-639 with M2 chip, I have tried to add **+language_name** tag, but didn't help. Someone mention a similar issue under [#659](https://github.com/axiomatic-systems/Bento4/issues/659#issuecomment-1372841466). Not sure if this is a bug after the Apple Silicon build.
Edit: I also tried on windows and got "ERROR: cannot access local variable 'language_name' where it is not associated with a value" | Subtitles (WebVTT) not added to HLS playlist when running mp4dash with --hls | https://api.github.com/repos/axiomatic-systems/Bento4/issues/848/comments | 2 | 2023-04-02T07:11:48Z | 2023-05-29T02:26:09Z | https://github.com/axiomatic-systems/Bento4/issues/848 | 1,650,839,932 | 848 |
[
"axiomatic-systems",
"Bento4"
] | I have manually set the offsets in the co64 atom.
Because I am recovering a mp4 video file which does not have a moov atom so I'm reconstructing the atoms manually.
Every time when i do:
`mp4edit --replace moov/trak[0]/mdia/minf/stbl/co64:co64.atom moov.atom moov.atom_2`
mp4edit always creates a new mdat and also changes all of the co64 atom values.
How to prevent mp4edit in creating a new mdat atom and also changing the co64 offset values?
Thanks. | How to update/replace the co64 atom without creating a new mdat or changing the co64 atom values after replacement? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/847/comments | 1 | 2023-03-15T07:21:45Z | 2023-05-29T02:34:30Z | https://github.com/axiomatic-systems/Bento4/issues/847 | 1,624,906,572 | 847 |
[
"axiomatic-systems",
"Bento4"
] | I have a co64.atom and would like to replace/insert it to a moov atom.
I was able to remove a co64.atom using the following syntax:
`mp4edit --remove moov/trak/mdia/minf/stbl/co64 moov.atom moov.atom_edit`
However I'm not able to replace or insert a new co64.atom to the same moov.atom file:
`mp4edit --insert moov/trak/mdia/minf/stbl:co64.atom moov.atom moov.atom_edit`
I get the following error:
`ERROR: failed to create atom`
Thanks for any advice. | How to insert or replace co64.atom to the moov atom? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/846/comments | 1 | 2023-03-14T22:43:08Z | 2023-03-15T07:22:50Z | https://github.com/axiomatic-systems/Bento4/issues/846 | 1,624,414,408 | 846 |
[
"axiomatic-systems",
"Bento4"
] |
# Summary
Hello, I found out-of-memory bug in mp4decrypt
# BUG
out-of-memory (/home/ubuntu/fuzz/asan_bento4/Bento4/cmakebuild/mp4decrypt+0x4c44ed) in operator new(unsigned long)
# Build
ubuntu 20.04
```
export CC=clang
export CXX=clang++
export CFLAGS="-fsanitize=address -g"
export CXXFLAGS="-fsanitize=address -g"
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
```
./mp42aac poc4.mp4 /dev/null
=================================================================
==1465845==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x800000010 bytes
#0 0x4c44ed in operator new(unsigned long) (/home/ubuntu/fuzz/asan_bento4/Bento4/cmakebuild/mp4decrypt+0x4c44ed)
#1 0x5c1d7e in AP4_Array<AP4_TrunAtom::Entry>::EnsureCapacity(unsigned int) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4Array.h:172:25
#2 0x5c1d7e in AP4_Array<AP4_TrunAtom::Entry>::SetItemCount(unsigned int) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4Array.h:210:25
#3 0x5c1d7e in AP4_TrunAtom::AP4_TrunAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4TrunAtom.cpp:150:9
#4 0x5c1672 in AP4_TrunAtom::Create(unsigned int, AP4_ByteStream&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4TrunAtom.cpp:51:16
#5 0x4c9fad in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:438:20
#6 0x4c8fb1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x50b1db in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#8 0x50a42e in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#9 0x50a42e in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#10 0x4ca7ac in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#11 0x4c8fb1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#12 0x50b1db in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#13 0x50a42e in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#14 0x50a42e in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#15 0x4ca7ac in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#16 0x4c8fb1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#17 0x4c87db in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#18 0x52896e in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4File.cpp:104:12
#19 0x528e7a in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4File.cpp:78:5
#20 0x4c7621 in main /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:202:32
#21 0x7f99a9e02082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
==1465845==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory (/home/ubuntu/fuzz/asan_bento4/Bento4/cmakebuild/mp4decrypt+0x4c44ed) in operator new(unsigned long)
```
# poc
https://github.com/z1r00/fuzz_vuln/blob/main/Bento4/mp4decrypt/oom/poc6.zip
| out-of-memory in mp4decrypt | https://api.github.com/repos/axiomatic-systems/Bento4/issues/845/comments | 1 | 2023-03-14T12:52:18Z | 2024-02-17T17:16:02Z | https://github.com/axiomatic-systems/Bento4/issues/845 | 1,623,417,978 | 845 |
[
"axiomatic-systems",
"Bento4"
] |
# Summary
Hello, I found SEGV bug in Ap4TrunAtom.h
# BUG
SEGV /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4TrunAtom.h:80:80 in AP4_TrunAtom::SetDataOffset(int)
# Build
ubuntu 20.04
```
export CC=clang
export CXX=clang++
export CFLAGS="-fsanitize=address -g"
export CXXFLAGS="-fsanitize=address -g"
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
```
./mp42aac poc4.mp4 /dev/null
AddressSanitizer:DEADLYSIGNAL
=================================================================
==1110587==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000028 (pc 0x000000562a98 bp 0x7ffdb6c29220 sp 0x7ffdb6c28e80 T0)
==1110587==The signal is caused by a WRITE memory access.
==1110587==Hint: address points to the zero page.
#0 0x562a98 in AP4_TrunAtom::SetDataOffset(int) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4TrunAtom.h:80:80
#1 0x562a98 in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4Processor.cpp:285:19
#2 0x567c4f in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4Processor.cpp:721:18
#3 0x4c7b98 in main /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#4 0x7ff6f6ed9082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
#5 0x41c63d in _start (/home/ubuntu/fuzz/asan_bento4/Bento4/cmakebuild/mp4decrypt+0x41c63d)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4TrunAtom.h:80:80 in AP4_TrunAtom::SetDataOffset(int)
==1110587==ABORTING
```
# poc
https://github.com/z1r00/fuzz_vuln/blob/main/Bento4/mp4decrypt/sigv/poc5.zip
| SEGV Ap4TrunAtom.h:80:80 in AP4_TrunAtom::SetDataOffset(int) | https://api.github.com/repos/axiomatic-systems/Bento4/issues/844/comments | 0 | 2023-03-14T12:42:26Z | 2024-02-17T17:48:33Z | https://github.com/axiomatic-systems/Bento4/issues/844 | 1,623,402,397 | 844 |
[
"axiomatic-systems",
"Bento4"
] | SUMMARY: AddressSanitizer: heap-buffer-overflow in /Source/C++/Apps/Mp4Info/Mp4Info.cpp:1196
- Version
```
$ ./mp4info
MP4 File Info - Version 1.3.4
(Bento4 Version 1.6.0.0)
(c) 2002-2017 Axiomatic Systems, LLC
```
branch [ab5591e](https://github.com/axiomatic-systems/Bento4/commit/ab5591eced36fa034b5203692cdd4b4730d46e31)
- Platform
```
$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ uname -r
5.15.0-57-generic
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
```
- Steps to reproduce
```
$ mkdir build_asan
$ cd build_asan
$ cmake .. -DCMAKE_CXX_FLAGS="-fsanitize=address -g" -DCMAKE_C_FLAGS="-fsanitize=address -g" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" -DCMAKE_MODULE_LINKER_FLAGS="-fsanitize=address"
$ make
$ ./mp4info --show-samples poc
```
- Asan
```
$ ./mp4info --show-samples poc
Movie:
duration: 0 (movie timescale units)
duration: 0 (ms)
time scale: 0
fragments: yes
Found 1 Tracks
Track 1:
flags: 3158064
id: 1
type: Unknown []
duration: 0 ms
language: (null)
media:
sample count: 0
timescale: 0
duration: 0 (media timescale units)
duration: 0 (ms)
bitrate (computed): 0.000 Kbps
sample count with fragments: 1
duration with fragments: 0
duration with fragments: 0 (ms)
display width: 12336.188477
display height: 12336.188477
Sample Description 0
Coding: avc1 (H.264)
Codec String: avc1.303030
AVC Profile: 48
AVC Profile Compat: 30
AVC Level: 48
AVC NALU Length Size: 1
AVC SPS: []
AVC PPS: []
Width: 12336
Height: 12336
Depth: 12336
Track 1:
=================================================================
==3661750==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000002f1 at pc 0x561368557323 bp 0x7ffd84a9d4e0 sp 0x7ffd84a9d4d0
READ of size 1 at 0x6020000002f1 thread T0
#0 0x561368557322 in ShowAvcInfo /home/cl3nn0/Downloads/test/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1196
#1 0x561368557747 in ShowSample_Text /home/cl3nn0/Downloads/test/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1263
#2 0x56136855ae0a in ShowFragments_Text /home/cl3nn0/Downloads/test/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1822
#3 0x56136855b786 in main /home/cl3nn0/Downloads/test/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1927
#4 0x7f088f13c082 in __libc_start_main ../csu/libc-start.c:308
#5 0x56136854e8ad in _start (/home/cl3nn0/Downloads/test/Bento4/build_asan/mp4info+0x3268ad)
0x6020000002f1 is located 0 bytes to the right of 1-byte region [0x6020000002f0,0x6020000002f1)
allocated by thread T0 here:
#0 0x7f088f765787 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cc:107
#1 0x5613685a4a6e in AP4_DataBuffer::ReallocateBuffer(unsigned int) /home/cl3nn0/Downloads/test/Bento4/Source/C++/Core/Ap4DataBuffer.cpp:210
#2 0x5613685a4875 in AP4_DataBuffer::SetData(unsigned char const*, unsigned int) /home/cl3nn0/Downloads/test/Bento4/Source/C++/Core/Ap4DataBuffer.cpp:169
#3 0x5613685be9c5 in AP4_LinearReader::PopSample(AP4_LinearReader::Tracker*, AP4_Sample&, AP4_DataBuffer*) /home/cl3nn0/Downloads/test/Bento4/Source/C++/Core/Ap4LinearReader.cpp:497
#4 0x5613685bee3e in AP4_LinearReader::ReadNextSample(AP4_Sample&, AP4_DataBuffer*, unsigned int&) /home/cl3nn0/Downloads/test/Bento4/Source/C++/Core/Ap4LinearReader.cpp:570
#5 0x5613685bef19 in AP4_LinearReader::ReadNextSample(AP4_Sample&, AP4_DataBuffer&, unsigned int&) /home/cl3nn0/Downloads/test/Bento4/Source/C++/Core/Ap4LinearReader.cpp:591
#6 0x56136855ab3e in ShowFragments_Text /home/cl3nn0/Downloads/test/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1797
#7 0x56136855b786 in main /home/cl3nn0/Downloads/test/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1927
#8 0x7f088f13c082 in __libc_start_main ../csu/libc-start.c:308
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/cl3nn0/Downloads/test/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1196 in ShowAvcInfo
Shadow bytes around the buggy address:
0x0c047fff8000: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa fd fd
0x0c047fff8010: fa fa 00 04 fa fa 00 fa fa fa fd fd fa fa fd fd
0x0c047fff8020: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa
0x0c047fff8030: fa fa fd fa fa fa fd fa fa fa fd fd fa fa 01 fa
0x0c047fff8040: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fa
=>0x0c047fff8050: fa fa 00 fa fa fa fd fa fa fa fd fa fa fa[01]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
0x0c047fff80a0: 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
==3661750==ABORTING
```
poc : [poc.zip](https://github.com/axiomatic-systems/Bento4/files/10964165/poc.zip)
Thanks! | heap-buffer-overflow in /Source/C++/Apps/Mp4Info/Mp4Info.cpp:1196 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/843/comments | 0 | 2023-03-14T04:46:08Z | 2023-05-29T02:24:13Z | https://github.com/axiomatic-systems/Bento4/issues/843 | 1,622,715,249 | 843 |
[
"axiomatic-systems",
"Bento4"
] |
# Summary
Hello, I found out-of-memory bug in mp42aac
# BUG
out-of-memory (/home/ubuntu/fuzz/asan_bento4/Bento4/cmakebuild/mp42aac+0x4c44dd) in operator new(unsigned long)
# Build
ubuntu 20.04
```
export CC=clang
export CXX=clang++
export CFLAGS="-fsanitize=address -g"
export CXXFLAGS="-fsanitize=address -g"
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
```
./mp42aac poc4.mp4 /dev/null
=================================================================
==1258592==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x800000010 bytes
#0 0x4c44dd in operator new(unsigned long) (/home/ubuntu/fuzz/asan_bento4/Bento4/cmakebuild/mp42aac+0x4c44dd)
#1 0x6054ee in AP4_Array<AP4_TrunAtom::Entry>::EnsureCapacity(unsigned int) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4Array.h:172:25
#2 0x6054ee in AP4_Array<AP4_TrunAtom::Entry>::SetItemCount(unsigned int) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4Array.h:210:25
#3 0x6054ee in AP4_TrunAtom::AP4_TrunAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4TrunAtom.cpp:150:9
#4 0x604de2 in AP4_TrunAtom::Create(unsigned int, AP4_ByteStream&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4TrunAtom.cpp:51:16
#5 0x53a0dd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:438:20
#6 0x5390e1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x57718b in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#8 0x5763de in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#9 0x5763de in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#10 0x53a8dc in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#11 0x5390e1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#12 0x57718b in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#13 0x5763de in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#14 0x5763de in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#15 0x53a8dc in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#16 0x5390e1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#17 0x53890b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#18 0x4ceffe in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4File.cpp:104:12
#19 0x4cf50a in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4File.cpp:78:5
#20 0x4c7232 in main /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:250:22
#21 0x7fb9e650c082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
==1258592==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory (/home/ubuntu/fuzz/asan_bento4/Bento4/cmakebuild/mp42aac+0x4c44dd) in operator new(unsigned long)
==1258592==ABORTING
```
# poc
https://github.com/z1r00/fuzz_vuln/blob/main/Bento4/mp42aac/poc4.zip
| out-of-memory in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/842/comments | 1 | 2023-03-14T02:50:05Z | 2024-02-17T17:52:59Z | https://github.com/axiomatic-systems/Bento4/issues/842 | 1,622,631,441 | 842 |
[
"axiomatic-systems",
"Bento4"
] |
# Summary
Hello, I found out-of-memory bug in mp42avc
# BUG
out-of-memory (/home/ubuntu/fuzz/asan_bento4/Bento4/cmakebuild/mp42avc+0x4c44dd) in operator new(unsigned long)
# Build
ubuntu 20.04
```
export CC=clang
export CXX=clang++
export CFLAGS="-fsanitize=address -g"
export CXXFLAGS="-fsanitize=address -g"
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
```
./mp42avc poc3.mp4 /dev/null
=================================================================
==1349287==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x400000010 bytes
#0 0x4c44dd in operator new(unsigned long) (/home/ubuntu/fuzz/asan_bento4/Bento4/cmakebuild/mp42avc+0x4c44dd)
#1 0x6063ae in AP4_Array<AP4_TrunAtom::Entry>::EnsureCapacity(unsigned int) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4Array.h:172:25
#2 0x6063ae in AP4_Array<AP4_TrunAtom::Entry>::SetItemCount(unsigned int) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4Array.h:210:25
#3 0x6063ae in AP4_TrunAtom::AP4_TrunAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4TrunAtom.cpp:150:9
#4 0x605ca2 in AP4_TrunAtom::Create(unsigned int, AP4_ByteStream&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4TrunAtom.cpp:51:16
#5 0x53af9d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:438:20
#6 0x539fa1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x57804b in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#8 0x57729e in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#9 0x57729e in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#10 0x53b79c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#11 0x539fa1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#12 0x57804b in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#13 0x57729e in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#14 0x57729e in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#15 0x53b79c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#16 0x539fa1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#17 0x5397cb in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#18 0x4cfebe in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4File.cpp:104:12
#19 0x4d03ca in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Core/Ap4File.cpp:78:5
#20 0x4c7064 in main /home/ubuntu/fuzz/asan_bento4/Bento4/Source/C++/Apps/Mp42Avc/Mp42Avc.cpp:307:32
#21 0x7f877ffc1082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
==1349287==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory (/home/ubuntu/fuzz/asan_bento4/Bento4/cmakebuild/mp42avc+0x4c44dd) in operator new(unsigned long)
==1349287==ABORTING
```
# poc
https://github.com/z1r00/fuzz_vuln/blob/main/Bento4/mp42avc/poc3.zip
| out-of-memory in mp42avc | https://api.github.com/repos/axiomatic-systems/Bento4/issues/841/comments | 1 | 2023-03-14T02:40:15Z | 2024-02-17T17:49:29Z | https://github.com/axiomatic-systems/Bento4/issues/841 | 1,622,623,759 | 841 |
[
"axiomatic-systems",
"Bento4"
] |
# Summary
Hello, I found out-of-memory bug in mp4info
# BUG
out-of-memory (/home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/cmakebuild/mp4info+0x4c44ed) in operator new(unsigned long)
# Build
ubuntu 20.04
```
export CC=clang
export CXX=clang++
export CFLAGS="-fsanitize=address -g"
export CXXFLAGS="-fsanitize=address -g"
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
```
./mp4info poc2.mp4
File:
major brand: mp42
minor version: 1
compatible brand: isom
compatible brand: mp42
compatible brand: dash
fast start: yes
Movie:
duration: 0 (movie timescale units)
duration: 0 (ms)
time scale: 600
fragments: yes
Found 2 Tracks
Track 1:
flags: 15 ENABLED IN-MOVIE IN-PREVIEW
id: 1
type: Video
duration: 0 ms
language: eng
media:
sample count: 0
timescale: 25
duration: 0 (media timescale units)
duration: 0 (ms)
=================================================================
==318973==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x800000010 bytes
#0 0x4c44ed in operator new(unsigned long) (/home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/cmakebuild/mp4info+0x4c44ed)
#1 0x5c311e in AP4_Array<AP4_TrunAtom::Entry>::EnsureCapacity(unsigned int) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4Array.h:172:25
#2 0x5c311e in AP4_Array<AP4_TrunAtom::Entry>::SetItemCount(unsigned int) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4Array.h:210:25
#3 0x5c311e in AP4_TrunAtom::AP4_TrunAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4TrunAtom.cpp:150:9
#4 0x5c2a12 in AP4_TrunAtom::Create(unsigned int, AP4_ByteStream&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4TrunAtom.cpp:51:16
#5 0x4fa6fd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:438:20
#6 0x4f9701 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x50befb in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#8 0x50b14e in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#9 0x50b14e in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#10 0x4faefc in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#11 0x4f9701 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#12 0x50befb in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#13 0x50b14e in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#14 0x50b14e in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#15 0x4faefc in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#16 0x4f9701 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#17 0x4f8f2b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#18 0x53df79 in AP4_LinearReader::AdvanceFragment() /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4LinearReader.cpp:350:31
#19 0x53ec11 in AP4_LinearReader::Advance(bool) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4LinearReader.cpp:443:33
#20 0x6060000002bf (<unknown module>)
==318973==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory (/home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/cmakebuild/mp4info+0x4c44ed) in operator new(unsigned long)
==318973==ABORTING
```
# poc
https://github.com/z1r00/fuzz_vuln/blob/main/Bento4/mp4info/poc2.zip
| out-of-memory in mp4info | https://api.github.com/repos/axiomatic-systems/Bento4/issues/840/comments | 0 | 2023-03-14T02:26:20Z | 2024-02-17T17:08:01Z | https://github.com/axiomatic-systems/Bento4/issues/840 | 1,622,614,615 | 840 |
[
"axiomatic-systems",
"Bento4"
] |
# Summary
Hello, I found out-of-memory bug in mp4dump
# BUG
out-of-memory (/home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/cmakebuild/mp4dump+0x4c44fd) in operator new(unsigned long)
# Build
ubuntu 20.04
```
export CC=clang
export CXX=clang++
export CFLAGS="-fsanitize=address -g"
export CXXFLAGS="-fsanitize=address -g"
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
```
./mp4dump poc1.mp4
[ftyp] size=8+16
major_brand = iso5
minor_version = 1
compatible_brand = dash
compatible_brand = iso5
[free] size=8+50
[moov] size=8+673
[mvhd] size=12+96
timescale = 1000
duration = 0
duration(ms) = 0
[mvex] size=8+48
[mehd] size=12+4
duration = 2043
[trex] size=12+20
track id = 1
default sample description index = 1
default sample duration = 1024
default sample size = 0
default sample flags = 0
[trak] size=8+404
[tkhd] size=12+80, flags=f
enabled = 1
id = 1
duration = 0
width = 0.000000
height = 0.000000
[mdia] size=8+304
[mdhd] size=12+20
timescale = 44100
duration = 0
duration(ms) = 0
language = und
[hdlr] size=12+33
handler_type = soun
handler_name = SoundHandler
[minf] size=8+219
[smhd] size=12+4
balance = 0
[dinf] size=8+28
[dref] size=12+16
[url ] size=12+0, flags=1
location = [local to file]
[stbl] size=8+159
[stsd] size=12+79
entry_count = 1
[mp4a] size=8+67
data_reference_index = 1
channel_count = 2
sample_size = 16
sample_rate = 44100
[esds] size=12+27
[ESDescriptor] size=2+25
es_id = 1
stream_priority = 0
[DecoderConfig] size=2+17
stream_type = 5
object_type = 64
up_stream = 0
buffer_size = 0
max_bitrate = 128000
avg_bitrate = 58307
DecoderSpecificInfo = 12 08
[Descriptor:06] size=2+1
[stts] size=12+4
entry_count = 0
[stsc] size=12+4
entry_count = 0
[stsz] size=12+8
sample_size = 0
sample_count = 0
[stco] size=12+4
entry_count = 0
[udta] size=8+89
[meta] size=12+77
[hdlr] size=12+21
handler_type = mdir
handler_name =
[ilst] size=8+36
[.too] size=8+28
[data] size=8+20
type = 1
lang = 0
value = Lavf55.8.100
[sidx] size=12+32
reference_ID = 1
timescale = 44100
earliest_presentation_time = 0
first_offset = 0
[moof] size=8+120
[mfhd] size=12+4
sequence number = 1
[traf] size=8+96
[tfhd] size=12+8, flags=20020
track ID = 1
default sample flags = 2000000
[tfdt] size=12+4
base media decode time = 0
[trun] size=12+48, flags=201
sample count = 10
data offset = 136
[mdat] size=8+1153
[sidx] size=12+32
reference_ID = 1
timescale = 44100
earliest_presentation_time = 10240
first_offset = 0
[moof] size=8+120
[mfhd] size=12+4
sequence number = 2
[traf] size=8+96
[tfhd] size=12+8, flags=20020
track ID = 1
default sample flags = 2000000
[tfdt] size=12+4
base media decode time = 10240
[trun] size=12+48, flags=201
sample count = 10
data offset = 136
[mdat] size=8+1397
[sidx] size=12+32
reference_ID = 1
timescale = 44100
earliest_presentation_time = 20480
first_offset = 0
[moof] size=8+120
[mfhd] size=12+4
sequence number = 3
[traf] size=8+96
[tfhd] size=12+8, flags=20020
track ID = 1
default sample flags = 2000000
[tfdt] size=12+4
base media decode time = 20480
[trun] size=12+48, flags=201
sample count = 10
data offset = 136
[mdat] size=8+1799
[sidx] size=12+32
reference_ID = 1
timescale = 44100
earliest_presentation_time = 30720
first_offset = 0
[moof] size=8+120
[mfhd] size=12+4
sequence number = 4
[traf] size=8+96
[tfhd] size=12+8, flags=20020
track ID = 1
default sample flags = 2000000
[tfdt] size=12+4
base media decode time = 30720
[trun] size=12+48, flags=201
sample count = 10
data offset = 136
[mdat] size=8+1819
[sidx] size=12+32
reference_ID = 1
timescale = 44100
earliest_presentation_time = 40960
first_offset = 0
[moof] size=8+120
[mfhd] size=12+4
sequence number = 5
[traf] size=8+96
[tfhd] size=12+8, flags=20020
track ID = 1
default sample flags = 2000000
[tfdt] size=12+4
base media decode time = 40960
[trun] size=12+48, flags=201
sample count = 10
data offset = 136
[mdat] size=8+1811
[sidx] size=12+32
reference_ID = 1
timescale = 44100
earliest_presentation_time = 51200
first_offset = 0
[moof] size=8+120
[mfhd] size=12+4
sequence number = 6
[traf] size=8+96
[tfhd] size=12+8, flags=20020
track ID = 1
default sample flags = 2000000
[tfdt] size=12+4
base media decode time = 51200
[trun] size=12+48, flags=201
sample count = 10
data offset = 136
[mdat] size=8+1810
[sidx] size=12+32
reference_ID = 1
timescale = 44100
earliest_presentation_time = 61440
first_offset = 0
[moof] size=8+120
[mfhd] size=12+4
sequence number = 7
[traf] size=8+96
[tfhd] size=12+8, flags=20020
track ID = 1
default sample flags = 2000000
[tfdt] size=12+4
base media decode time = 61440
[trun] size=12+48, flags=201
sample count = 10
data offset = 136
[mdat] size=8+1832
[sidx] size=12+32
reference_ID = 1
timescale = 44100
earliest_presentation_time = 71680
first_offset = 0
[moof] size=8+120
[mfhd] size=12+4
sequence number = 8
[traf] size=8+96
[tfhd] size=12+8, flags=20020
track ID = 1
default sample flags = 2000000
[tfdt] size=12+4
base media decode time = 71680
[trun] size=12+48, flags=201
sample count = 10
data offset = 136
[mdat] size=8+1811
[sidx] size=12+32
reference_ID = 1
timescale = 44100
earliest_presentation_time = 81920
first_offset = 0
[moof] size=8+108
[mfhd] size=12+4
sequence number = 9
[traf] size=8+84
[tfhd] size=12+8, flags=20020
track ID = 1
default sample flags = 2000000
[tfdt] size=12+4
base media decode time = 81920
[trun] size=12+36, flags=201
sample count = 7
data offset = 124
[mdat] size=8+1285
[sidx] size=12+32
reference_ID = 1
timescale = 44100
earliest_presentation_time = 89088
first_offset = 0
=================================================================
==3592421==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0xc00000010 bytes
#0 0x4c44fd in operator new(unsigned long) (/home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/cmakebuild/mp4dump+0x4c44fd)
#1 0x59f18e in AP4_Array<AP4_TrunAtom::Entry>::EnsureCapacity(unsigned int) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4Array.h:172:25
#2 0x59f18e in AP4_Array<AP4_TrunAtom::Entry>::SetItemCount(unsigned int) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4Array.h:210:25
#3 0x59f18e in AP4_TrunAtom::AP4_TrunAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4TrunAtom.cpp:150:9
#4 0x59ea82 in AP4_TrunAtom::Create(unsigned int, AP4_ByteStream&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4TrunAtom.cpp:51:16
#5 0x4df50d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:438:20
#6 0x4de511 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x4f0c1b in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#8 0x4efe6e in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#9 0x4efe6e in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#10 0x4dfd0c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#11 0x4de511 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#12 0x4f0c1b in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#13 0x4efe6e in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#14 0x4efe6e in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#15 0x4dfd0c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#16 0x4de511 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#17 0x4ddd3b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#18 0x4c8d57 in main /home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/Source/C++/Apps/Mp4Dump/Mp4Dump.cpp:342:25
#19 0x7ffff7a6b082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
==3592421==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory (/home/ubuntu/fuzz/Bento4_fuzz/asan/Bento4/cmakebuild/mp4dump+0x4c44fd) in operator new(unsigned long)
==3592421==ABORTING
```
# poc
https://github.com/z1r00/fuzz_vuln/blob/main/Bento4/mp4dump/poc1.zip
| out-of-memory in mp4dump | https://api.github.com/repos/axiomatic-systems/Bento4/issues/839/comments | 1 | 2023-03-14T02:17:13Z | 2024-02-17T17:21:37Z | https://github.com/axiomatic-systems/Bento4/issues/839 | 1,622,602,124 | 839 |
[
"axiomatic-systems",
"Bento4"
] | Hello.
I have a corrupt h264 mp4 video which does not have a moov file.
I can reconstruct the moov file manually by looking into the mdat atom and using a hex editor to find all the video and audio heuristics relating to start and stop NAL code and also other things like chunk_offset.
I am also comparing moov data from another non-corrupted video file produced from the same camera. This is making things easy to reconstruct the moov file manually for the corrupted mp4 video.
I was able to find about 90% of all of the chunk_offset values in the mdat atom of the corrupted file which does not have the moov file using the hex editor using heuristics.
Now how can I add these chunk_offset values into the co64 atom?
I extracted the co64 atom using mp4extract but have no idea how to modify the values, the hex editor can not recognize any texts of numbers or what not that embeds the chunk_offset's values... maybe I need to change the character encoding?
Here is what the hex editor shows (I'm using "imhex" editor):

Thanks. | How can I change the values for stco's "chunk_offset"? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/838/comments | 1 | 2023-03-12T07:07:41Z | 2023-05-29T02:48:14Z | https://github.com/axiomatic-systems/Bento4/issues/838 | 1,620,260,411 | 838 |
[
"axiomatic-systems",
"Bento4"
] | I have two MP4 files from the same video camera.
One mp4 file has the moov while the other does not.
So how can I insert a moov atom into the mp4 file which does not have the moov atom and then I can start adding the correct values in the moov atom?
Thanks. | How to copy the moov atom from one mp4 file and inset it into another mp4 file? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/837/comments | 1 | 2023-03-11T04:45:14Z | 2023-03-12T06:29:57Z | https://github.com/axiomatic-systems/Bento4/issues/837 | 1,619,880,717 | 837 |
[
"axiomatic-systems",
"Bento4"
] | We found a loophole in the program. The crash occurred on line 90 of the AP4_SgpdAtom function in the Ap4SgpdAtom.cpp file. A loop was executed within the function, but due to an unknown error, the entry_count variable controlling the rotation of the loop overflowed to 2147483649 (231 + 1). The loop continues, resulting in insufficient memory and the program was killed by the system kernel, resulting in a crash. We think the cause of the dead loop: entry_count is initialized on line 89, and the function that caused the exception to this variable is stream.ReadUI32(entry_count) on line 90. The call to this function causes the entry_count variable to become a very large value, causing an endless loop to occur. | Found a vulnerability in the program(Maybe?) | https://api.github.com/repos/axiomatic-systems/Bento4/issues/835/comments | 0 | 2023-02-27T07:59:28Z | 2023-05-29T02:42:58Z | https://github.com/axiomatic-systems/Bento4/issues/835 | 1,600,669,209 | 835 |
[
"axiomatic-systems",
"Bento4"
] | I have a change for MP4HLS which is quite simple.
Change
` if (video_ts <= audio_ts) {
chosen_track = video_track;
}`
to
` if ((video_ts <= audio_ts) || audio_eos) {
chosen_track = video_track;
}`
So that all input video frames will be packaged into the output ts segment.
I have a branch for a PR, but do not have access to push the branch. | MP42HLS Video Frames after Audio EOS | https://api.github.com/repos/axiomatic-systems/Bento4/issues/833/comments | 0 | 2023-02-17T00:32:16Z | 2023-02-17T00:32:41Z | https://github.com/axiomatic-systems/Bento4/issues/833 | 1,588,576,898 | 833 |
[
"axiomatic-systems",
"Bento4"
] | Hi, developers of Bento4:
In the test of the binary mp42aac instrumented with ASAN. There is a huge memory allocation vulnerability in mp42aac, `Bento4/Source/C++/Core/Ap4RtpAtom.cpp:50`. Here is the ASAN mode output:
=================================================================
==28243==ERROR: AddressSanitizer: requested allocation size 0xffffffffe7000003 (0xffffffffe7001008 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0)
#0 0x4f2778 in operator new[](unsigned long) /root/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x6065e7 in AP4_RtpAtom::AP4_RtpAtom(unsigned int, AP4_ByteStream&) (/root/Bento4/build/mp42aac+0x6065e7)
==28243==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: allocation-size-too-big /root/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102 in operator new[](unsigned long)
==28243==ABORTING
### Crash input
https://github.com/17ssDP/fuzzer_crashes/blob/main/Bento4/mp42aac-alloc
### Validation 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
./mp42aac mp42aac-alloc /dev/null
### Environment
Ubuntu 16.04
Clang 10.0.1
gcc 5.5 | huge memory allocation vulnerability in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/832/comments | 0 | 2023-02-13T01:44:24Z | 2023-05-29T02:48:59Z | https://github.com/axiomatic-systems/Bento4/issues/832 | 1,581,504,292 | 832 |
[
"axiomatic-systems",
"Bento4"
] | Hello. I am an end-user. I'm looking for a program that connects Dolby AC4 audio streams, and Bento4 seems to be the only solution. Is it possible? | Is there a way to concat dolby AC4-IMS files? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/831/comments | 1 | 2023-02-05T13:38:07Z | 2023-02-05T23:39:43Z | https://github.com/axiomatic-systems/Bento4/issues/831 | 1,571,433,552 | 831 |
[
"axiomatic-systems",
"Bento4"
] | I'm tasked with inserting custom metadata that can be read back to define at timestamp X of an MP4 file obtain certain data, a key value pair lets say.
Is Bento4 the right tool for the job?
FFMPEG seems to only let you modify an MP4s global metadata, nothing local or at certain intervals. | Can this be used to read and write custom metadata to an MP4 at certain timestamps? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/830/comments | 2 | 2023-02-04T01:08:10Z | 2023-02-04T20:50:15Z | https://github.com/axiomatic-systems/Bento4/issues/830 | 1,570,683,542 | 830 |
[
"axiomatic-systems",
"Bento4"
] | After mux with `mp4mux`, video frame rate changed to 59.940 (59940/1000).
```
mp4mux.exe --track "h265:638110311955762453.hevc#dv_profile=5,frame_rate=59.94" "638110311955762453.hevc.mp4"
```
Mediainfo:
```
Frame rate : 59.940 (59940/1000) FPS
Original frame rate : 59.940 (60000/1001) FPS
``` | mp4mux: How to set frame rate to 59.940 (60000/1001) instead of 59.940 (59940/1000) | https://api.github.com/repos/axiomatic-systems/Bento4/issues/829/comments | 2 | 2023-02-03T06:35:31Z | 2023-02-06T05:46:57Z | https://github.com/axiomatic-systems/Bento4/issues/829 | 1,569,302,995 | 829 |
[
"axiomatic-systems",
"Bento4"
] | Does dash support ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format? | Is there support for SSA subtitles? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/828/comments | 1 | 2023-01-27T15:08:16Z | 2023-02-04T20:35:28Z | https://github.com/axiomatic-systems/Bento4/issues/828 | 1,559,920,115 | 828 |
[
"axiomatic-systems",
"Bento4"
] | Hello Bento4 Support,
When I package a single resolution video it stores the output inside "output/video/avc1/<here>". But when I package a video with multiple resolution, it stroes the output inside "output/video/avc1/1/<here>; output/video/avc1/2/<here>; so on ..".
Q. If I want to store Single resolution Packaging inside "**output/video/avc1/1**/<here>", then what to do ??
Please suggest.
Thanks
Tanmaya Patra | Dedicated directory in case Single resolution Dash Packaging | https://api.github.com/repos/axiomatic-systems/Bento4/issues/827/comments | 2 | 2023-01-24T09:17:59Z | 2023-02-05T05:51:44Z | https://github.com/axiomatic-systems/Bento4/issues/827 | 1,554,601,339 | 827 |
[
"axiomatic-systems",
"Bento4"
] | Please see #825 | Endian support isn't fixed for powerpc | https://api.github.com/repos/axiomatic-systems/Bento4/issues/826/comments | 1 | 2023-01-18T11:57:38Z | 2023-02-04T20:37:18Z | https://github.com/axiomatic-systems/Bento4/issues/826 | 1,537,871,712 | 826 |
[
"axiomatic-systems",
"Bento4"
] | The command is [mp4dash --use-segment-timeline --encryption-key=dca91b8a6ed0c7e64783821b7259a7e5:3bbfc67195fb55f9917fa146270d5dd1 --widevine-header=provider:widevine_test#content_id:dca91b8a6ed0c7e64783821b7259a7e5#kid:3bbfc67195fb55f9917fa146270d5dd1 --profiles=on-demand --mpd-name=dash.mpd -f -o widevine fragmented.mp4]
<img width="792" alt="スクリーンショット 2023-01-13 12 24 32" src="https://user-images.githubusercontent.com/38561128/212237154-ccb1e967-ad93-437c-a4ef-b70c520b34b3.png">
but if i remove [--profiles=on-demand] it will not warn fragment duration too large, how do i use on-demand and don't warn | mp4dash on profile on-demand fragment duration too large | https://api.github.com/repos/axiomatic-systems/Bento4/issues/824/comments | 1 | 2023-01-13T04:26:46Z | 2023-01-17T03:29:21Z | https://github.com/axiomatic-systems/Bento4/issues/824 | 1,531,691,690 | 824 |
[
"axiomatic-systems",
"Bento4"
] | Can you please add binaries for arm architecture on the official downloads page
https://www.bento4.com/downloads/ | binary for arm architecture linux on downloads page | https://api.github.com/repos/axiomatic-systems/Bento4/issues/823/comments | 0 | 2023-01-03T11:23:07Z | 2023-05-29T02:37:55Z | https://github.com/axiomatic-systems/Bento4/issues/823 | 1,517,256,589 | 823 |
[
"axiomatic-systems",
"Bento4"
] | I'm trying to use mp4dump to determine if the MOOV atom is at the front of the file or at the end. In the output of my file, the MOOV atom is printed before the MDAT atom (and in fact it is the second atom printed behind `ftyp`).
Is that the order in the actual file? | Question: Does the order of the output of mp4dump reflect the order of the atoms in the file? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/822/comments | 2 | 2022-12-09T19:03:33Z | 2022-12-12T17:37:13Z | https://github.com/axiomatic-systems/Bento4/issues/822 | 1,487,282,994 | 822 |
[
"axiomatic-systems",
"Bento4"
] | Hi there,
I'm having an issue where MP4Info sees 5.1 audio as:
MPEG-4 Audio Object Type: 2 (AAC Low Complexity)
MPEG-4 Audio Decoder Config:
Sampling Frequency: 48000
Channels: 6
Sample Rate: 48000
Sample Size: 16
Channels: 2
And manifest from MP4Dash will show file as having 2 channels.
"
StreamIndex Chunks="3591" Language="en" Name="audio_en" QualityLevels="1" TimeScale="10000000" Type="audio" Url="QualityLevels({bitrate})/Fragments(audio_en={start time})"
QualityLevel AudioTag="255" Bitrate="272050" BitsPerSample="16" Channels="2" CodecPrivateData="131056e598" FourCC="AACL" Index="0" PacketSize="4" SamplingRate="24000"/
"
I have tried different version of Bento4 with no luck.
Any ideas?
Thanks | MP4Info giving incorrect Audio Channel count. Manifest from MP4 Dash has wrong audio channels. | https://api.github.com/repos/axiomatic-systems/Bento4/issues/821/comments | 6 | 2022-12-06T12:17:36Z | 2023-02-22T13:48:41Z | https://github.com/axiomatic-systems/Bento4/issues/821 | 1,478,964,123 | 821 |
[
"axiomatic-systems",
"Bento4"
] | I'm trying to encrypt a single video file that has multiple audio tracks muxed in it. This file will be downloaded to a device, not streamed, and we are using PlayReady DRM. After encrypting the file I am able to open the file in Chrome and play it with no problem. Even-though mp4info says it is encrypted it still plays.
mp4encrypt does give me this warning:
WARNING: this encryption method only applies to fragmented files
I fragment the files then use ffmpeg to combine the tracks I need. Then I encrypt. Any ideas? Should I do this differently?
Here are the commands I'm doing.
#!/bin/bash
mp4fragment --fragment-duration 3000 A35637_EN_SP_GE_IT_720p_3000kbps_en-US.mp4 ./fragmented/A35637_EN_SP_GE_IT_720p_3000kbps_en-US.mp4
mp4fragment --fragment-duration 3000 A35637_EN_SP_GE_IT_de-DE.mp4 ./fragmented/A35637_EN_SP_GE_IT_de-DE.mp4
mp4fragment --fragment-duration 3000 A35637_EN_SP_GE_IT_en-US.mp4 ./fragmented/A35637_EN_SP_GE_IT_en-US.mp4
mp4fragment --fragment-duration 3000 A35637_EN_SP_GE_IT_es-ES.mp4 ./fragmented/A35637_EN_SP_GE_IT_es-ES.mp4
mp4fragment --fragment-duration 3000 A35637_EN_SP_GE_IT_it-IT.mp4 ./fragmented/A35637_EN_SP_GE_IT_it-IT.mp4
ffmpeg -i ./fragmented/A35637_EN_SP_GE_IT_720p_3000kbps_en-US.mp4 \
-i ./fragmented/A35637_EN_SP_GE_IT_en-US.mp4 \
-i ./fragmented/A35637_EN_SP_GE_IT_de-DE.mp4 \
-i ./fragmented/A35637_EN_SP_GE_IT_es-ES.mp4 \
-i ./fragmented/A35637_EN_SP_GE_IT_it-IT.mp4 \
-map 0:v:0 -map 1:a:0 -map 2:a:0 -map 3:a:0 -map 4:a:0 \
-c copy ./fragmented/MUXED_A33219_E2_WS_XX_XX.mp4
python3 create-playready-header.py -kid DA8DB6CCF7BA70C970E083519623EFC8 -k FE20AE699404146A854F7B2CA39E36D8 -o ./fragmented/Playready.bin
mp4encrypt --method MPEG-CENC --global-option mpeg-cenc.piff-compatible:true \
--pssh 9a04f07998404286ab92e65be0885f95:./fragmented/Playready.bin \
--key 1:FE20AE699404146A854F7B2CA39E36D8:random \
--property 1:KID:DA8DB6CCF7BA70C970E083519623EFC8 \
--key 2:FE20AE699404146A854F7B2CA39E36D8:random \
--property 2:KID:DA8DB6CCF7BA70C970E083519623EFC8 \
--key 3:FE20AE699404146A854F7B2CA39E36D8:random \
--property 3:KID:DA8DB6CCF7BA70C970E083519623EFC8 \
--key 4:FE20AE699404146A854F7B2CA39E36D8:random \
--property 4:KID:DA8DB6CCF7BA70C970E083519623EFC8 \
--key 5:FE20AE699404146A854F7B2CA39E36D8:random \
--property 5:KID:DA8DB6CCF7BA70C970E083519623EFC8 \
./fragmented/MUXED_A33219_E2_WS_XX_XX.mp4 ./output.mp4
| video encrypted with mp4encrypt is playable in chrome. | https://api.github.com/repos/axiomatic-systems/Bento4/issues/819/comments | 4 | 2022-12-01T15:26:30Z | 2023-05-30T14:25:58Z | https://github.com/axiomatic-systems/Bento4/issues/819 | 1,471,512,329 | 819 |
[
"axiomatic-systems",
"Bento4"
] | Hi, developers of Bento4:
When I tested the latest mp42aac, the following crash occurred.
## The problem
The optput of mp42aac_asan:
```
==115490==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000ee71 at pc 0x000000509921 bp 0x7fffffffd410 sp 0x7fffffffd400
READ of size 1 at 0x60200000ee71 thread T0
#0 0x509920 in AP4_Stz2Atom::AP4_Stz2Atom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:113
#1 0x509ac6 in AP4_Stz2Atom::Create(unsigned int, AP4_ByteStream&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:52
#2 0x46efde in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:483
#3 0x472452 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234
#4 0x472452 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154
#5 0x40bd11 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4File.cpp:104
#6 0x40bd11 in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4File.cpp:78
#7 0x402a40 in main /home/xxzs/workdir/test/Bento4/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:250
#8 0x7ffff621f83f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#9 0x4045d8 in _start (/home/xxzs/workdir/test/mp42aac/mp42aac_asan+0x4045d8)
0x60200000ee71 is located 0 bytes to the right of 1-byte region [0x60200000ee70,0x60200000ee71)
allocated by thread T0 here:
#0 0x7ffff6f036b2 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x996b2)
#1 0x509235 in AP4_Stz2Atom::AP4_Stz2Atom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:101
#2 0x509ac6 in AP4_Stz2Atom::Create(unsigned int, AP4_ByteStream&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:52
#3 0x46efde in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:483
#4 0x472452 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234
#5 0x472452 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154
#6 0x40bd11 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4File.cpp:104
#7 0x40bd11 in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4File.cpp:78
#8 0x402a40 in main /home/xxzs/workdir/test/Bento4/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:250
#9 0x7ffff621f83f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:113 AP4_Stz2Atom::AP4_Stz2Atom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&)
Shadow bytes around the buggy address:
0x0c047fff9d70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9d80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9d90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c047fff9dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa[01]fa
0x0c047fff9dd0: fa fa fd fa fa fa 00 04 fa fa fd fa fa fa fd fa
0x0c047fff9de0: fa fa fd fa fa fa 00 04 fa fa fd fa fa fa fd fa
0x0c047fff9df0: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00
0x0c047fff9e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9e10: 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==115490==ABORTING
[Inferior 1 (process 115490) exited with code 01]
```
The output of gdb:
```
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./mp42aac...done.
(gdb) set args /home/xxzs/workdir/test/mp42aac/out/afl-slave/crashes/id:000239,sig:06,src:000523+002959,op:splice,rep:2 /dev/null
(gdb) r
Starting program: /home/xxzs/workdir/test/mp42aac/mp42aac /home/xxzs/workdir/test/mp42aac/out/afl-slave/crashes/id:000239,sig:06,src:000523+002959,op:splice,rep:2 /dev/null
Program received signal SIGSEGV, Segmentation fault.
AP4_Stz2Atom::AP4_Stz2Atom (this=0x6b5bb0, size=<optimized out>, version=<optimized out>,
flags=<optimized out>, stream=...)
at /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:113
113 m_Entries[i] = (buffer[i/2]>>4)&0x0F;
(gdb) bt
#0 AP4_Stz2Atom::AP4_Stz2Atom (this=0x6b5bb0, size=<optimized out>, version=<optimized out>,
flags=<optimized out>, stream=...)
at /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:113
#1 0x000000000045b112 in AP4_Stz2Atom::Create (size=28, stream=...)
at /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:52
#2 0x00000000004268b5 in AP4_AtomFactory::CreateAtomFromStream (this=0x7fffffffdc70, stream=...,
type=1937013298, size_32=28, size_64=28, atom=@0x7fffffffdc60: 0x0)
at /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:483
#3 0x00000000004283c6 in AP4_AtomFactory::CreateAtomFromStream (atom=@0x7fffffffdc60: 0x0,
bytes_available=<synthetic pointer>, stream=..., this=0x7fffffffdc70)
at /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234
#4 AP4_AtomFactory::CreateAtomFromStream (this=this@entry=0x7fffffffdc70, stream=...,
atom=@0x7fffffffdc60: 0x0) at /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154
#5 0x0000000000403e12 in AP4_File::ParseStream (moov_only=<optimized out>, atom_factory=...,
stream=..., this=<optimized out>) at /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4File.cpp:104
#6 AP4_File::AP4_File (this=0x6b5610, stream=..., moov_only=false)
at /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4File.cpp:78
#7 0x000000000040134f in main (argc=<optimized out>, argv=<optimized out>)
at /home/xxzs/workdir/test/Bento4/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:250
(gdb) list
108 m_Entries.SetItemCount((AP4_Cardinal)sample_count);
109 switch (m_FieldSize) {
110 case 4:
111 for (unsigned int i=0; i<sample_count; i++) {
112 if ((i%2) == 0) {
113 m_Entries[i] = (buffer[i/2]>>4)&0x0F;
114 } else {
115 m_Entries[i] = buffer[i/2]&0x0F;
116 }
117 }
```
## Crash input
[POC2.tar.gz](https://github.com/axiomatic-systems/Bento4/files/10095915/POC2.tar.gz)
## Validation steps
1. build the latest mp42aac
2. ./mp42aac ./POC2 /dev/null
## Environment
* Host Operating System and version: Ubuntu 16.04 LTS
* Host CPU architecture: 11th Gen Intel® Core™ i5-11500 @ 2.70GHz × 8
* gcc version: 5.4.0
| heap-buffer-overflow in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/818/comments | 0 | 2022-11-26T08:35:48Z | 2023-05-29T02:39:18Z | https://github.com/axiomatic-systems/Bento4/issues/818 | 1,465,089,664 | 818 |
[
"axiomatic-systems",
"Bento4"
] | Hi, developers of Bento4:
When I tested the latest mp42aac, the following crash occurred.
## The problem
The optput of mp42aac:
```
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
```
The output of mp42aac_asan:
```
==114645==ERROR: AddressSanitizer failed to allocate 0xf262dd000 (65065046016) bytes of LargeMmapAllocator (errno: 12)
==114645==Process memory map follows:
0x000000400000-0x00000057c000 /home/xxzs/workdir/test/mp42aac/mp42aac_asan
0x00000077b000-0x00000077c000 /home/xxzs/workdir/test/mp42aac/mp42aac_asan
0x00000077c000-0x00000078b000 /home/xxzs/workdir/test/mp42aac/mp42aac_asan
0x00007fff7000-0x00008fff7000
0x00008fff7000-0x02008fff7000
0x02008fff7000-0x10007fff8000
0x600000000000-0x602000000000
0x602000000000-0x602000010000
0x602000010000-0x603000000000
0x603000000000-0x603000010000
0x603000010000-0x604000000000
0x604000000000-0x604000010000
0x604000010000-0x607000000000
0x607000000000-0x607000010000
0x607000010000-0x616000000000
0x616000000000-0x616000020000
0x616000020000-0x619000000000
0x619000000000-0x619000020000
0x619000020000-0x621000000000
0x621000000000-0x621000020000
0x621000020000-0x624000000000
0x624000000000-0x624000020000
0x624000020000-0x631000000000
0x631000000000-0x631000030000
0x631000030000-0x640000000000
0x640000000000-0x640000003000
0x7f6fa9700000-0x7f6fa9800000
0x7f6fa9900000-0x7f6fa9a00000
0x7f6fa9a15000-0x7f6fabd67000
0x7f6fabd67000-0x7f6fabd6a000 /lib/x86_64-linux-gnu/libdl-2.23.so
0x7f6fabd6a000-0x7f6fabf69000 /lib/x86_64-linux-gnu/libdl-2.23.so
0x7f6fabf69000-0x7f6fabf6a000 /lib/x86_64-linux-gnu/libdl-2.23.so
0x7f6fabf6a000-0x7f6fabf6b000 /lib/x86_64-linux-gnu/libdl-2.23.so
0x7f6fabf6b000-0x7f6fabf83000 /lib/x86_64-linux-gnu/libpthread-2.23.so
0x7f6fabf83000-0x7f6fac182000 /lib/x86_64-linux-gnu/libpthread-2.23.so
0x7f6fac182000-0x7f6fac183000 /lib/x86_64-linux-gnu/libpthread-2.23.so
0x7f6fac183000-0x7f6fac184000 /lib/x86_64-linux-gnu/libpthread-2.23.so
0x7f6fac184000-0x7f6fac188000
0x7f6fac188000-0x7f6fac348000 /lib/x86_64-linux-gnu/libc-2.23.so
0x7f6fac348000-0x7f6fac548000 /lib/x86_64-linux-gnu/libc-2.23.so
0x7f6fac548000-0x7f6fac54c000 /lib/x86_64-linux-gnu/libc-2.23.so
0x7f6fac54c000-0x7f6fac54e000 /lib/x86_64-linux-gnu/libc-2.23.so
0x7f6fac54e000-0x7f6fac552000
0x7f6fac552000-0x7f6fac568000 /lib/x86_64-linux-gnu/libgcc_s.so.1
0x7f6fac568000-0x7f6fac767000 /lib/x86_64-linux-gnu/libgcc_s.so.1
0x7f6fac767000-0x7f6fac768000 /lib/x86_64-linux-gnu/libgcc_s.so.1
0x7f6fac768000-0x7f6fac870000 /lib/x86_64-linux-gnu/libm-2.23.so
0x7f6fac870000-0x7f6faca6f000 /lib/x86_64-linux-gnu/libm-2.23.so
0x7f6faca6f000-0x7f6faca70000 /lib/x86_64-linux-gnu/libm-2.23.so
0x7f6faca70000-0x7f6faca71000 /lib/x86_64-linux-gnu/libm-2.23.so
0x7f6faca71000-0x7f6facbe3000 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
0x7f6facbe3000-0x7f6facde3000 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
0x7f6facde3000-0x7f6facded000 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
0x7f6facded000-0x7f6facdef000 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
0x7f6facdef000-0x7f6facdf3000
0x7f6facdf3000-0x7f6facee7000 /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0
0x7f6facee7000-0x7f6fad0e7000 /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0
0x7f6fad0e7000-0x7f6fad0ea000 /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0
0x7f6fad0ea000-0x7f6fad0eb000 /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0
0x7f6fad0eb000-0x7f6fadd60000
0x7f6fadd60000-0x7f6fadd86000 /lib/x86_64-linux-gnu/ld-2.23.so
0x7f6fadf2b000-0x7f6fadf6b000
0x7f6fadf6c000-0x7f6fadf85000
0x7f6fadf85000-0x7f6fadf86000 /lib/x86_64-linux-gnu/ld-2.23.so
0x7f6fadf86000-0x7f6fadf87000 /lib/x86_64-linux-gnu/ld-2.23.so
0x7f6fadf87000-0x7f6fadf88000
0x7ffc3100b000-0x7ffc3102c000 [stack]
0x7ffc310c7000-0x7ffc310ca000 [vvar]
0x7ffc310ca000-0x7ffc310cc000 [vdso]
0xffffffffff600000-0xffffffffff601000 [vsyscall]
==114645==End of process memory map.
==114645==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix.cc:121 "(("unable to mmap" && 0)) != (0)" (0x0, 0x0)
#0 0x7f6face93631 (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xa0631)
#1 0x7f6face985e3 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xa55e3)
#2 0x7f6facea0611 (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xad611)
#3 0x7f6face15c0c (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x22c0c)
#4 0x7f6face8c4fe in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x994fe)
#5 0x50f523 in AP4_Array<AP4_TfraAtom::Entry>::EnsureCapacity(unsigned int) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4Array.h:172
#6 0x50f523 in AP4_Array<AP4_TfraAtom::Entry>::SetItemCount(unsigned int) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4Array.h:210
#7 0x50f523 in AP4_TfraAtom::AP4_TfraAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4TfraAtom.cpp:88
#8 0x50fae7 in AP4_TfraAtom::Create(unsigned int, AP4_ByteStream&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4TfraAtom.cpp:53
#9 0x470906 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:443
#10 0x472452 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234
#11 0x472452 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154
#12 0x40bd11 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4File.cpp:104
#13 0x40bd11 in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/xxzs/workdir/test/Bento4/Source/C++/Core/Ap4File.cpp:78
#14 0x402a40 in main /home/xxzs/workdir/test/Bento4/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:250
#15 0x7f6fac1a883f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#16 0x4045d8 in _start (/home/xxzs/workdir/test/mp42aac/mp42aac_asan+0x4045d8)
```
## Crash input
[POC1.zip](https://github.com/axiomatic-systems/Bento4/files/10090406/POC1.zip)
## Validation steps
1. build the latest mp42aac
2. ./mp42aac ./POC1 /dev/null
## Environment
* Host Operating System and version: Ubuntu 16.04 LTS
* Host CPU architecture: 11th Gen Intel® Core™ i5-11500 @ 2.70GHz × 8
* gcc version: 5.4.0
| std::bad_alloc in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/816/comments | 0 | 2022-11-25T09:46:22Z | 2023-05-29T02:41:03Z | https://github.com/axiomatic-systems/Bento4/issues/816 | 1,464,280,948 | 816 |
[
"axiomatic-systems",
"Bento4"
] | When I follow the instructions listed [here](https://github.com/axiomatic-systems/Bento4#cmakemake) I don't end up with the same thing as [here](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip). That is, I don't end up with an installable package:
```
$ make install cmake gcc
make: *** No rule to make target 'install'. Stop.
```
There isn't a clean list of `include` files, not a clean `bin/` directory, etc... I would like to reproduce what is offered on the downloads page. Any and all help is greatly appreciated. :bowing_man:
Thank you! | [Help] How to package bento4 with cmake | https://api.github.com/repos/axiomatic-systems/Bento4/issues/815/comments | 2 | 2022-11-20T00:34:37Z | 2022-12-13T02:56:44Z | https://github.com/axiomatic-systems/Bento4/issues/815 | 1,456,715,669 | 815 |
[
"axiomatic-systems",
"Bento4"
] | Hi, there.
There is an heap overflow in ReadPartial, Ap4StdCFileByteStream.cpp:341, in the newest master branch 5e7bb34a08272c49242196eba1cefab8af55f381, which seems to be incomplete fix of issue #510.
Here is the reproducing command:
~~~~
mp42info poc
~~~~
POC:
[mp4info_overflow_ReadPartial341.zip](https://github.com/axiomatic-systems/Bento4/files/9987970/mp4info_overflow_ReadPartial341.zip)
(unzip first)
The reason of this overflow can causes arbitrary code execution by memory manipulation since user can control the content parsed by the program.
<img width="1070" alt="image" src="https://user-images.githubusercontent.com/7632714/201291288-61ee3c92-1dca-4934-9382-6030a46d4340.png">
Here is the reproduce trace reported by ASAN:
~~~~
==1448318==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000171 at pc 0x000000471d71 bp 0x7ffd4dd08e80 sp 0x7ffd4dd08630
WRITE of size 30 at 0x602000000171 thread T0
#0 0x471d70 in __interceptor_fread.part.0 /dependence/llvm11/llvm-11.0.0.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:1027:16
#1 0x66f795 in AP4_StdcFileByteStream::ReadPartial(void*, unsigned int, unsigned int&) /benchmark/Bento4/Source/C++/System/StdC/Ap4StdCFileByteStream.cpp:341:14
#2 0x549ce9 in AP4_ByteStream::Read(void*, unsigned int) /benchmark/Bento4/Source/C++/Core/Ap4ByteStream.cpp:54:29
#3 0x6601bb in AP4_MetaDataStringAtom::AP4_MetaDataStringAtom(unsigned int, unsigned int, AP4_ByteStream&) /benchmark/Bento4/Source/C++/MetaData/Ap4MetaData.cpp:1637:12
#4 0x6601bb in AP4_MetaDataAtomTypeHandler::CreateAtom(unsigned int, unsigned int, AP4_ByteStream&, unsigned int, AP4_Atom*&) /benchmark/Bento4/Source/C++/MetaData/Ap4MetaData.cpp:428:24
#5 0x53d50b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:844:21
#6 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x553677 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#8 0x5529a3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#9 0x5529a3 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#10 0x660634 in AP4_MetaDataAtomTypeHandler::CreateAtom(unsigned int, unsigned int, AP4_ByteStream&, unsigned int, AP4_Atom*&) /benchmark/Bento4/Source/C++/MetaData/Ap4MetaData.cpp:419:20
#11 0x53d50b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:844:21
#12 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#13 0x553677 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#14 0x5529a3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#15 0x5529a3 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#16 0x53def3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#17 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#18 0x55389e in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#19 0x552c6e in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:154:5
#20 0x552c6e in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:86:20
#21 0x53dd0d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:830:20
#22 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#23 0x553677 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#24 0x5529a3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#25 0x5529a3 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#26 0x53def3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#27 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#28 0x5746a6 in AP4_DrefAtom::AP4_DrefAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4DrefAtom.cpp:84:16
#29 0x573f60 in AP4_DrefAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4DrefAtom.cpp:50:16
#30 0x53ed78 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:580:20
#31 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#32 0x553677 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#33 0x5529a3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#34 0x5529a3 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#35 0x53def3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#36 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#37 0x53b237 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#38 0x579c4b in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /benchmark/Bento4/Source/C++/Core/Ap4File.cpp:104:12
#39 0x57a2ff in AP4_File::AP4_File(AP4_ByteStream&, bool) /benchmark/Bento4/Source/C++/Core/Ap4File.cpp:78:5
#40 0x4fb236 in main /benchmark/Bento4/Source/C++/Apps/Mp4Info/Mp4Info.cpp:1852:26
#41 0x7f2c774ff082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#42 0x41d89d in _start (/benchmark/Bento4/build-a/mp4info+0x41d89d)
0x602000000171 is located 0 bytes to the right of 1-byte region [0x602000000170,0x602000000171)
allocated by thread T0 here:
#0 0x4f7fc7 in operator new[](unsigned long) /dependence/llvm11/llvm-11.0.0.src/projects/compiler-rt/lib/asan/asan_new_delete.cpp:102:3
#1 0x60b04d in AP4_String::AP4_String(unsigned int) /benchmark/Bento4/Source/C++/Core/Ap4String.cpp:85:15
#2 0x53d50b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:844:21
#3 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#4 0x553677 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#5 0x5529a3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#6 0x5529a3 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#7 0x660634 in AP4_MetaDataAtomTypeHandler::CreateAtom(unsigned int, unsigned int, AP4_ByteStream&, unsigned int, AP4_Atom*&) /benchmark/Bento4/Source/C++/MetaData/Ap4MetaData.cpp:419:20
#8 0x53d50b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:844:21
#9 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#10 0x553677 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#11 0x5529a3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#12 0x5529a3 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#13 0x53def3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#14 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#15 0x55389e in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#16 0x552c6e in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:154:5
#17 0x552c6e in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:86:20
#18 0x53dd0d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:830:20
#19 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#20 0x553677 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#21 0x5529a3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#22 0x5529a3 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#23 0x53def3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#24 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#25 0x5746a6 in AP4_DrefAtom::AP4_DrefAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4DrefAtom.cpp:84:16
#26 0x573f60 in AP4_DrefAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4DrefAtom.cpp:50:16
#27 0x53ed78 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:580:20
#28 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#29 0x553677 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#30 0x5529a3 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#31 0x5529a3 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#32 0x53def3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#33 0x53bbf1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#34 0x53b237 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /benchmark/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
SUMMARY: AddressSanitizer: heap-buffer-overflow /dependence/llvm11/llvm-11.0.0.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:1027:16 in __interceptor_fread.part.0
Shadow bytes around the buggy address:
0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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 00 00
0x0c047fff8010: fa fa 00 fa fa fa fd fa fa fa fd fa fa fa 01 fa
=>0x0c047fff8020: fa fa fd fa fa fa fd fa fa fa 01 fa fa fa[01]fa
0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8040: fa fa fa fa fa fa fa 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
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
==1448318==ABORTING
~~~~
| Heap overflow in mp4info, ReadPartial, Ap4StdCFileByteStream.cpp:341 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/812/comments | 0 | 2022-11-11T07:45:28Z | 2022-11-11T07:46:10Z | https://github.com/axiomatic-systems/Bento4/issues/812 | 1,445,073,819 | 812 |
[
"axiomatic-systems",
"Bento4"
] | Chrome and Firefox expect the the Opus codec name to be all lowercase. Is bento4 using the wrong codec name or is this to spec? HLS.JS currently only acknowledges the lowercase "opus" as well.
Edit: It looks like these browsers violate the MP4RA spec.

| Browsers expect Opus codec name to be lowercase. | https://api.github.com/repos/axiomatic-systems/Bento4/issues/811/comments | 1 | 2022-11-03T18:27:02Z | 2022-11-03T19:18:03Z | https://github.com/axiomatic-systems/Bento4/issues/811 | 1,435,095,285 | 811 |
[
"axiomatic-systems",
"Bento4"
] | Currently, I can't found any API to detect HEVC HDR10 (VUI parameter, SEI message).
Is there any plan to support it? | HEVC HDR10 parsing support | https://api.github.com/repos/axiomatic-systems/Bento4/issues/810/comments | 3 | 2022-11-03T06:12:56Z | 2023-12-29T03:48:53Z | https://github.com/axiomatic-systems/Bento4/issues/810 | 1,434,164,078 | 810 |
[
"axiomatic-systems",
"Bento4"
] | Hi,
I'm looking for a way to add new segment to `mp4dash` encrypted (PlayReady) output without re-generating everything from scratch.
My approach was to use `mp4encrypt` with the same key used in `mp4dash` and then to update the `mediaPresentationDuration` field in `stream.mpd` but it does not work - the player detects the new video length but fails to play the last segment and just skips it.
The new segment I'm trying to append is the same size as the ones in the original encrypted video.
My steps are:
1. `mp4dash.bat --encryption-key=09e367028f33436ca5dd60ffe6671e70:b42ca3172ee4e69bf51848a59db9cd13 --playready-header=LA_URL:http://playready.directtaps.net/pr/svc/rightsmanager.asmx video_clear.mp4`
2. `mp4encrypt.exe --method MPEG-CENC --key 1:09e367028f33436ca5dd60ffe6671e70:b42ca3172ee4e69bf51848a59db9cd13 --fragments-info init-enc.mp4 seg-xyz-clear.m4s seg-xyz-enc.m4s`
What is the correct way of doing this? any help appreciated. | Append new segment to existing mp4dash output | https://api.github.com/repos/axiomatic-systems/Bento4/issues/809/comments | 2 | 2022-10-30T16:08:42Z | 2022-11-13T06:23:31Z | https://github.com/axiomatic-systems/Bento4/issues/809 | 1,428,877,596 | 809 |
[
"axiomatic-systems",
"Bento4"
] | Can i decrypt 10 video files at a time with one key and if it is possible what is the command | mp4decpyt | https://api.github.com/repos/axiomatic-systems/Bento4/issues/807/comments | 1 | 2022-10-24T11:17:11Z | 2023-05-29T02:38:58Z | https://github.com/axiomatic-systems/Bento4/issues/807 | 1,420,665,764 | 807 |
[
"axiomatic-systems",
"Bento4"
] | Hi, there.
There is an heap overflow in ReadBits, Ap4Mp4AudioInfo.cpp:66, in the newest master branch 5e7bb34a08272c49242196eba1cefab8af55f381, which seems to be incomplete fix of issue #194.
Here is the reproducing command:
~~~~
mp42hls poc
~~~~
POC:
[mp42hls_ReadBits_Ap4Mp4AudioInfo66.zip](https://github.com/axiomatic-systems/Bento4/files/9849116/mp42hls_ReadBits_Ap4Mp4AudioInfo66.zip)
(unzip first)
Here is the reproduce trace reported by ASAN:
~~~~
==64087==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000275 at pc 0x000000511365 bp 0x7fff4cecb370 sp 0x7fff4cecb368
READ of size 1 at 0x602000000275 thread T0
#0 0x511364 in AP4_Mp4AudioDsiParser::ReadBits(unsigned int) /benchmark/Bento4/Source/C++/Codecs/Ap4Mp4AudioInfo.cpp:66:56
#1 0x511a50 in AP4_Mp4AudioDecoderConfig::ParseExtension(AP4_Mp4AudioDsiParser&) /benchmark/Bento4/Source/C++/Codecs/Ap4Mp4AudioInfo.cpp:159:20
#2 0x513cdb in AP4_Mp4AudioDecoderConfig::Parse(unsigned char const*, unsigned int) /benchmark/Bento4/Source/C++/Codecs/Ap4Mp4AudioInfo.cpp:317:30
#3 0x5a093c in AP4_Mpeg2TsAudioSampleStream::WriteSample(AP4_Sample&, AP4_DataBuffer&, AP4_SampleDescription*, bool, AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4Mpeg2Ts.cpp:442:44
#4 0x50991a in WriteSamples(AP4_Mpeg2TsWriter*, PackedAudioWriter*, AP4_Track*, SampleReader*, AP4_Mpeg2TsWriter::SampleStream*, AP4_Track*, SampleReader*, AP4_Mpeg2TsWriter::SampleStream*, unsigned int, unsigned char) /benchmark/Bento4/Source/C++/Apps/Mp42Hls/Mp42Hls.cpp:1274:40
#5 0x50991a in main /benchmark/Bento4/Source/C++/Apps/Mp42Hls/Mp42Hls.cpp:2188:14
#6 0x7efd53469082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#7 0x41d8ed in _start ( /benchmark/Bento4/build-a/mp42hls+0x41d8ed)
0x602000000275 is located 0 bytes to the right of 5-byte region [0x602000000270,0x602000000275)
allocated by thread T0 here:
#0 0x4f8017 in operator new[](unsigned long) /dependence/llvm11/llvm-11.0.0.src/projects/compiler-rt/lib/asan/asan_new_delete.cpp:102:3
#1 0x560ebf in AP4_DataBuffer::AP4_DataBuffer(void const*, unsigned int) /benchmark/Bento4/Source/C++/Core/Ap4DataBuffer.cpp:68:20
#2 0x5a093c in AP4_Mpeg2TsAudioSampleStream::WriteSample(AP4_Sample&, AP4_DataBuffer&, AP4_SampleDescription*, bool, AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4Mpeg2Ts.cpp:442:44
#3 0x50991a in WriteSamples(AP4_Mpeg2TsWriter*, PackedAudioWriter*, AP4_Track*, SampleReader*, AP4_Mpeg2TsWriter::SampleStream*, AP4_Track*, SampleReader*, AP4_Mpeg2TsWriter::SampleStream*, unsigned int, unsigned char) /benchmark/Bento4/Source/C++/Apps/Mp42Hls/Mp42Hls.cpp:1274:40
#4 0x50991a in main /benchmark/Bento4/Source/C++/Apps/Mp42Hls/Mp42Hls.cpp:2188:14
#5 0x7efd53469082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
SUMMARY: AddressSanitizer: heap-buffer-overflow /benchmark/Bento4/Source/C++/Codecs/Ap4Mp4AudioInfo.cpp:66:56 in AP4_Mp4AudioDsiParser::ReadBits(unsigned int)
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 05 fa
0x0c047fff8020: fa fa 06 fa fa fa 00 fa fa fa fd fd fa fa 04 fa
0x0c047fff8030: fa fa fd fa fa fa fd fa fa fa 01 fa fa fa 00 00
=>0x0c047fff8040: fa fa 00 00 fa fa 05 fa fa fa 00 04 fa fa[05]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
Shadow gap: cc
==64087==ABORTING
~~~~
| Heap overflow in mp4hls, ReadBits, Ap4Mp4AudioInfo.cpp:66 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/806/comments | 0 | 2022-10-24T06:03:44Z | 2023-05-29T02:38:17Z | https://github.com/axiomatic-systems/Bento4/issues/806 | 1,420,268,717 | 806 |
[
"axiomatic-systems",
"Bento4"
] | Hey folks,
I'm very interested in DRM technology as I'm building on a VOD platform. Basically the packaging process is fully done but currently without DRM. As I'm not interested in paying for a DRM provider, I would like to know if it is potentially possible to write your own Key exchange service for that? Or do I really need to pay a license fee here?
Thanks in advance and sorry if this might be the wrong place to ask this qustion.
| Is it actually possible to write your own DRM backend service? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/805/comments | 5 | 2022-10-20T22:10:46Z | 2023-03-25T19:32:21Z | https://github.com/axiomatic-systems/Bento4/issues/805 | 1,417,373,238 | 805 |
[
"axiomatic-systems",
"Bento4"
] | Is it possible to create HLS manifests with Bento4 that can specify one audio track with #EXT-STREAM-INF (default), and other language audio tracks #EXT-MEDIA tags? With the latest release of Bento4, I'm finding that multiple audio files without any video track/program will produce only #EXT-STREAM-INF and no #EXT-MEDIA tags:
```
python mp4-hls.py \
-o bento-hls-audio-only \
-f \
--segment-duration=10 \
--audio-format=ts \
[+label="audio",type=audio,+hls_default="NO",+hls_autoselect="NO",+language_name="French",+language="fr"]EJ5385032-fr.mp4 \
[+label="audio",type=audio,+hls_default="NO",+hls_autoselect="NO",+language_name="German",+language="de"]EJ5385032-de.mp4 \
[+label="audio",type=audio,+hls_default="NO",+hls_autoselect="NO",+language_name="French Canadian",+language="fr-CA"]EJ5385032-fr-CA.mp4 \
[+hls_group="subtitles",+hls_default="YES",+hls_autoselect="YES",+format="webvtt",+language_name="English",+language="en"]EJ5385032.vtt \
[+hls_group="subtitles",+hls_default="NO",+hls_autoselect="NO",+format="webvtt",+language_name="French",+language="fr"]EJ5385032-fr.vtt \
[+hls_group="subtitles",+hls_default="NO",+hls_autoselect="NO",+format="webvtt",+language_name="German",+language="de"]EJ5385032-de.vtt \
[+hls_group="subtitles",+hls_default="NO",+hls_autoselect="NO",+format="webvtt",+language_name="French Canadian",+language="fr-CA"]EJ5385032-fr-CA.vtt \
[+label="audio",+language_name="English",+language="en"]EJ5385032-en-orig.mp4
```
produces:
```
#EXTM3U
# Created with Bento4 mp4-hls.py version 1.2.0r639
#EXT-X-VERSION:4
# Subtitles
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="English",LANGUAGE="en",URI="subtitles/en/subtitles.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="French",LANGUAGE="fr",URI="subtitles/fr/subtitles.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="German",LANGUAGE="de",URI="subtitles/de/subtitles.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="French Canadian",LANGUAGE="fr-CA",URI="subtitles/fr-CA/subtitles.m3u8"
# Media Playlists
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=142905,BANDWIDTH=144253,CODECS="mp4a.40.2",SUBTITLES="subtitles"
media-1/stream.m3u8
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=143394,BANDWIDTH=144757,CODECS="mp4a.40.2",SUBTITLES="subtitles"
media-2/stream.m3u8
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=143207,BANDWIDTH=144841,CODECS="mp4a.40.2",SUBTITLES="subtitles"
media-3/stream.m3u8
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=78102,BANDWIDTH=86715,CODECS="mp4a.40.2",SUBTITLES="subtitles"
media-4/stream.m3u8
```
However, what I need is something like this:
```
#EXTM3U
# Created with Bento4 mp4-hls.py version 1.2.0r639
#EXT-X-VERSION:4
# Subtitles
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="English",LANGUAGE="en",URI="subtitles/en/subtitles.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="French",LANGUAGE="fr",URI="subtitles/fr/subtitles.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="German",LANGUAGE="de",URI="subtitles/de/subtitles.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",NAME="French Canadian",LANGUAGE="fr-CA",URI="subtitles/fr-CA/subtitles.m3u8"
# Audio
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_aac",NAME="English",LANGUAGE="en"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_aac",NAME="French",LANGUAGE="fr",AUTOSELECT=YES,URI="audio/aac/fr/stream.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_aac",NAME="German",LANGUAGE="de",AUTOSELECT=YES,URI="audio/aac/de/stream.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_aac",NAME="French Canadian",LANGUAGE="fr-CA",AUTOSELECT=YES,URI="audio/aac/fr-CA/stream.m3u8"
# Media Playlists
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=142905,BANDWIDTH=144253,CODECS="mp4a.40.2",SUBTITLES="subtitles",AUDIO="audio_aac"
audio/aac/en/stream.m3u8
``` | Multilingual audio-only HLS manifests? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/804/comments | 1 | 2022-10-19T22:38:25Z | 2022-10-20T17:10:53Z | https://github.com/axiomatic-systems/Bento4/issues/804 | 1,415,659,610 | 804 |
[
"axiomatic-systems",
"Bento4"
] | A memory allocation failure unhandled in Ap4RtpAtom.cpp and leads to crashes. This seems to be an incomplete fix of issue #396, CVE-2019-13238.
`./mp42aac input_file /dev/null`
In file Source/C++/Core/Ap4RtpAtom.cpp
<img width="929" alt="image" src="https://user-images.githubusercontent.com/7632714/196694985-02cb68d8-62b7-44e4-ac8a-01137ddd038e.png">
AP4_RtpAtom allocate a new buffer to parse the atom in the stream.
The unhandled memory allocation failure cause the read content memcpy to a null pointer.
The rest of issue seems be similar with previous issue.
Asan trace report:
~~~~
==725001==WARNING: AddressSanitizer failed to allocate 0xffffffffff00025b bytes
=================================================================
==725001==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0xffffffffff00025b bytes
#0 0x4f7fb7 in operator new[](unsigned long) /dependence/llvm11/llvm-11.0.0.src/projects/compiler-rt/lib/asan/asan_new_delete.cpp:102:3
#1 0x652e4a in AP4_RtpAtom::AP4_RtpAtom(unsigned int, AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4RtpAtom.cpp:50:25
==725001==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory /dependence/llvm11/llvm-11.0.0.src/projects/compiler-rt/lib/asan/asan_new_delete.cpp:102:3 in operator new[](unsigned long)
==725001==ABORTING
~~~~
[mp42aac_exhaustive_AP4_RtpAtom50.zip](https://github.com/axiomatic-systems/Bento4/files/9820612/mp42aac_exhaustive_AP4_RtpAtom50.zip)
(unzip first)
| Incomplete fix of CVE-2019-13238, Exhaustive memory misunhandle | https://api.github.com/repos/axiomatic-systems/Bento4/issues/803/comments | 0 | 2022-10-19T12:55:56Z | 2022-10-19T12:55:56Z | https://github.com/axiomatic-systems/Bento4/issues/803 | 1,414,926,196 | 803 |
[
"axiomatic-systems",
"Bento4"
] | Hi, there.
There is an heap overflow in mp42hls, GetOffset, Ap4Sample.h:99, in the newest commit 5e7bb34a08272c49242196eba1cefab8af55f381. This seems to be an incomplete fix of issue #461.
Here is the reproducing command:
~~~~
./mp42hls poc
~~~~
POC:
[mp42hls_cuaf_Ap4Sample99.zip](https://github.com/axiomatic-systems/Bento4/files/9817606/mp42hls_cuaf_Ap4Sample99.zip)
(unzip first)
Here is the reproduce trace reported by ASAN:
~~~~
==2007234==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000005dd8 at pc 0x0000005852ab bp 0x7ffc127b7960 sp 0x7ffc127b7958
READ of size 8 at 0x604000005dd8 thread T0
#0 0x5852aa in AP4_Sample::GetOffset() const /benchmark/Bento4/Source/C++/Core/Ap4Sample.h:99:48
#1 0x5852aa in AP4_LinearReader::Advance(bool) /benchmark/Bento4/Source/C++/Core/Ap4LinearReader.cpp:434:54
#2 0x585ab1 in AP4_LinearReader::ReadNextSample(unsigned int, AP4_Sample&, AP4_DataBuffer&) /benchmark/Bento4/Source/C++/Core/Ap4LinearReader.cpp:530:29
#3 0x509a31 in ReadSample(SampleReader&, AP4_Track&, AP4_Sample&, AP4_DataBuffer&, double&, double&, bool&) /benchmark/Bento4/Source/C++/Apps/Mp42Hls/Mp42Hls.cpp:1004:32
#4 0x509a31 in WriteSamples(AP4_Mpeg2TsWriter*, PackedAudioWriter*, AP4_Track*, SampleReader*, AP4_Mpeg2TsWriter::SampleStream*, AP4_Track*, SampleReader*, AP4_Mpeg2TsWriter::SampleStream*, unsigned int, unsigned char) /benchmark/Bento4/Source/C++/Apps/Mp42Hls/Mp42Hls.cpp:1289:22
#5 0x509a31 in main /benchmark/Bento4/Source/C++/Apps/Mp42Hls/Mp42Hls.cpp:2188:14
#6 0x7f33bacb6082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#7 0x41d8ed in _start ( /benchmark/Bento4/build-a/mp42hls+0x41d8ed)
0x604000005dd8 is located 8 bytes inside of 48-byte region [0x604000005dd0,0x604000005e00)
freed by thread T0 here:
#0 0x4f88b7 in operator delete(void*) /dependence/llvm11/llvm-11.0.0.src/projects/compiler-rt/lib/asan/asan_new_delete.cpp:160:3
#1 0x584f07 in AP4_LinearReader::SampleBuffer::~SampleBuffer() /benchmark/Bento4/Source/C++/Core/Ap4LinearReader.h:104:26
#2 0x584f07 in AP4_LinearReader::Advance(bool) /benchmark/Bento4/Source/C++/Core/Ap4LinearReader.cpp:462:17
previously allocated by thread T0 here:
#0 0x4f7eb7 in operator new(unsigned long) /dependence/llvm11/llvm-11.0.0.src/projects/compiler-rt/lib/asan/asan_new_delete.cpp:99:3
#1 0x584892 in AP4_LinearReader::Advance(bool) /benchmark/Bento4/Source/C++/Core/Ap4LinearReader.cpp:422:41
SUMMARY: AddressSanitizer: heap-use-after-free /benchmark/Bento4/Source/C++/Core/Ap4Sample.h:99:48 in AP4_Sample::GetOffset() const
Shadow bytes around the buggy address:
0x0c087fff8b60: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fd
0x0c087fff8b70: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fd
0x0c087fff8b80: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fd
0x0c087fff8b90: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fd
0x0c087fff8ba0: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fd
=>0x0c087fff8bb0: fa fa fd fd fd fd fd fa fa fa fd[fd]fd fd fd fd
0x0c087fff8bc0: fa fa fd fd fd fd fd fa fa fa fa fa fa fa fa fa
0x0c087fff8bd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff8be0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff8bf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff8c00: 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
==2007234==ABORTING
~~~~
| Concurrent heap use after free in mp42hls, GetOffset, Ap4Sample.h:99 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/802/comments | 0 | 2022-10-19T06:53:27Z | 2023-05-29T02:40:07Z | https://github.com/axiomatic-systems/Bento4/issues/802 | 1,414,407,802 | 802 |
[
"axiomatic-systems",
"Bento4"
] | Hi, there.
There is a reachable assertion failure in mp4fragment, Ap4Atom.cpp:763, in the newest commit 5b7cc250. This issue seems to be an incomplete fix of issues #197, #351, and #547. It is related to issue #777 but has a different reproducing way.
To reproduce, run:
~~~~
./mp4fragment poc /dev/null
~~~~
Here is the trace reported by ASAN:
~~~~
==1783207==ERROR: AddressSanitizer: ABRT on unknown address 0x03ea001b35a7 (pc 0x7f1579cfe00b bp 0x7f1579e73588 sp 0x7ffff0b21170 T0)
#0 0x7f1579cfe00b in raise /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#1 0x7f1579cdd858 in abort /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:79:7
#2 0x7f1579cdd728 in __assert_fail_base /build/glibc-SzIz7B/glibc-2.31/assert/assert.c:92:3
#3 0x7f1579ceefd5 in __assert_fail /build/glibc-SzIz7B/glibc-2.31/assert/assert.c:101:3
#4 0x5153f0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:763:5
#5 0x540f21 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
#6 0x540f21 in AP4_ContainerAtom::WriteFields(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:232:23
#7 0x514ff0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:757:11
#8 0x540f21 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
#9 0x540f21 in AP4_ContainerAtom::WriteFields(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:232:23
#10 0x514ff0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:757:11
#11 0x5dfac2 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
#12 0x5dfac2 in AP4_SampleEntry::Write(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4SampleEntry.cpp:176:23
#13 0x514ff0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:757:11
#14 0x600622 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
#15 0x600622 in AP4_StsdAtom::WriteFields(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4StsdAtom.cpp:144:23
#16 0x514ff0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:757:11
#17 0x540f21 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
#18 0x540f21 in AP4_ContainerAtom::WriteFields(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:232:23
#19 0x514ff0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:757:11
#20 0x540f21 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
#21 0x540f21 in AP4_ContainerAtom::WriteFields(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:232:23
#22 0x514ff0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:757:11
#23 0x540f21 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
#24 0x540f21 in AP4_ContainerAtom::WriteFields(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:232:23
#25 0x514ff0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:757:11
#26 0x540f21 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
#27 0x540f21 in AP4_ContainerAtom::WriteFields(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:232:23
#28 0x514ff0 in AP4_AtomListWriter::Action(AP4_Atom*) const /benchmark/Bento4/Source/C++/Core/Ap4Atom.cpp:757:11
#29 0x540f21 in AP4_List<AP4_Atom>::Apply(AP4_List<AP4_Atom>::Item::Operator const&) const /benchmark/Bento4/Source/C++/Core/Ap4List.h:353:12
#30 0x540f21 in AP4_ContainerAtom::WriteFields(AP4_ByteStream&) /benchmark/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:232:23
#31 0x507e23 in Fragment(AP4_File&, AP4_ByteStream&, AP4_Array<TrackCursor*>&, unsigned int, unsigned int, bool, bool, bool) /benchmark/Bento4/Source/C++/Apps/Mp4Fragment/Mp4Fragment.cpp:824:34
#32 0x507e23 in main /benchmark/Bento4/Source/C++/Apps/Mp4Fragment/Mp4Fragment.cpp:1475:5
#33 0x7f1579cdf082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#34 0x41d8ad in _start ( /benchmark/Bento4/build-a/mp4fragment+0x41d8ad)
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
==1783207==ABORTING
~~~~
[mp4fragment_assertion_Ap4Atom.cpp763.zip](https://github.com/axiomatic-systems/Bento4/files/9817360/mp4fragment_assertion_Ap4Atom.cpp763.zip)
(unzip first) | Assertion Failure in mp4fragment, Ap4Atom.cpp:763 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/801/comments | 0 | 2022-10-19T06:14:58Z | 2023-05-29T02:40:06Z | https://github.com/axiomatic-systems/Bento4/issues/801 | 1,414,360,066 | 801 |
[
"axiomatic-systems",
"Bento4"
] | Hi, there.
There is a segmentation fault caused by null pointer dereference in MP4fragment, Ap4StsdAtom.cpp:75 in the newest commit 5e7bb34a08272c49242196eba1cefab8af55f381.
The reason for this issue is that the return value of the GetSampleDescription is unchecked.
<img width="1055" alt="image" src="https://user-images.githubusercontent.com/7632714/196609587-2e88a5f1-1aac-4286-8c12-f28dd46e2f7b.png">
To reproduce, run:
~~~~
./mp4fragment poc /dev/null
~~~~
Here is the trace reported by ASAN:
~~~~
==3437252==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000005fcb24 bp 0x60b000000300 sp 0x7ffec2967f00 T0)
==3437252==The signal is caused by a READ memory access.
==3437252==Hint: address points to the zero page.
#0 0x5fcb24 in AP4_StsdAtom::AP4_StsdAtom(AP4_SampleTable*) /benchmark/Bento4/Source/C++/Core/Ap4StsdAtom.cpp:75:47
#1 0x6b7b51 in AP4_SampleTable::GenerateStblAtom(AP4_ContainerAtom*&) /benchmark/Bento4/Source/C++/Core/Ap4SampleTable.cpp:59:30
#2 0x620f26 in AP4_TrakAtom::AP4_TrakAtom(AP4_SampleTable*, unsigned int, char const*, unsigned int, unsigned long long, unsigned long long, unsigned long long, unsigned int, unsigned long long, unsigned short, char const*, unsigned int, unsigned int, unsigned short, unsigned short, int const*) /benchmark/Bento4/Source/C++/Core/Ap4TrakAtom.cpp:131:28
#3 0x61e255 in AP4_Track::AP4_Track(AP4_SampleTable*, unsigned int, unsigned int, unsigned long long, unsigned int, unsigned long long, AP4_Track const*) /benchmark/Bento4/Source/C++/Core/Ap4Track.cpp:183:22
#4 0x500733 in Fragment(AP4_File&, AP4_ByteStream&, AP4_Array<TrackCursor*>&, unsigned int, unsigned int, bool, bool, bool) /benchmark/Bento4/Source/C++/Apps/Mp4Fragment/Mp4Fragment.cpp:360:39
#5 0x500733 in main /benchmark/Bento4/Source/C++/Apps/Mp4Fragment/Mp4Fragment.cpp:1475:5
#6 0x7f0f643e9082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#7 0x41d8ad in _start ( /benchmark/Bento4/build-a/mp4fragment+0x41d8ad)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /benchmark/Bento4/Source/C++/Core/Ap4StsdAtom.cpp:75:47 in AP4_StsdAtom::AP4_StsdAtom(AP4_SampleTable*)
==3437252==ABORTING
~~~~
[mp4fragment_npd_Ap4StsdAtom.cpp75.zip](https://github.com/axiomatic-systems/Bento4/files/9817303/mp4fragment_npd_Ap4StsdAtom.cpp75.zip)
(unzip first) | Segmentation fault caused by null pointer dereference in MP4fragment, Ap4StsdAtom.cpp:75 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/800/comments | 0 | 2022-10-19T06:06:34Z | 2023-05-29T02:51:53Z | https://github.com/axiomatic-systems/Bento4/issues/800 | 1,414,350,784 | 800 |
[
"axiomatic-systems",
"Bento4"
] | With multiple video bitrates (specified as multiple MP4 files) in mp4hls, the video segments are written to folders named "media-1", "media-2", and so on. Is there a way to set this name in the optional property name/value pairs in front of the input files? I tried using +label="1000Kbps" but the naming convention stayed the same. I'm using Bento4 mp4-hls.py version 1.2.0r639. Thank you in advance for your reply! | Set video output folder names with mp4hls | https://api.github.com/repos/axiomatic-systems/Bento4/issues/799/comments | 0 | 2022-10-18T16:32:51Z | 2023-05-29T02:51:52Z | https://github.com/axiomatic-systems/Bento4/issues/799 | 1,413,521,467 | 799 |
[
"axiomatic-systems",
"Bento4"
] | Hi, developers of Bento4:
When I tested mp42aac, I found multiple bugs.
# Step To Reproduce
```
./mp42aac $POC /dev/null
```
# Environment
- Ubuntu 18.04 (docker)
- Bento4 latest commit [https://github.com/axiomatic-systems/Bento4/commit/5e7bb34a08272c49242196eba1cefab8af55f381](url)
# BUG1
```
(base) ./mp42aac POC1 /dev/null
==36796==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000094 at pc 0x5633adbea14d bp 0x7ffe4fc5cbb0 sp 0x7ffe4fc5cba8
READ of size 1 at 0x602000000094 thread T0
#0 0x5633adbea14c in AP4_BytesToUInt16BE(unsigned char const*) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Utils.h:113:22
#1 0x5633adbea14c in AP4_Stz2Atom::AP4_Stz2Atom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:128:32
#2 0x5633adbe91bd in AP4_Stz2Atom::Create(unsigned int, AP4_ByteStream&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:52:16
#3 0x5633adb126b1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:483:20
#4 0x5633adb0efa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#5 0x5633adb526a3 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#6 0x5633adb51929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#7 0x5633adb51929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#8 0x5633adb11383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#9 0x5633adb0efa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#10 0x5633adb52857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#11 0x5633adb51929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#12 0x5633adb51929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#13 0x5633adb11383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#14 0x5633adb0efa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#15 0x5633adb52857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#16 0x5633adb524e6 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#17 0x5633adacf35d in AP4_TrakAtom::AP4_TrakAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4TrakAtom.cpp:165:5
#18 0x5633adb132ea in AP4_TrakAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4TrakAtom.h:58:20
#19 0x5633adb11f73 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:413:20
#20 0x5633adb0efa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#21 0x5633adb52857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#22 0x5633adb524e6 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#23 0x5633ada93f3f in AP4_MoovAtom::AP4_MoovAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4MoovAtom.cpp:79:5
#24 0x5633adb1324a in AP4_MoovAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4MoovAtom.h:56:20
#25 0x5633adb12255 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:393:20
#26 0x5633adb0efa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#27 0x5633adb0e5f6 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#28 0x5633ada905fe in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4File.cpp:104:12
#29 0x5633ada90c12 in AP4_File::AP4_File(AP4_ByteStream&, bool) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4File.cpp:78:5
#30 0x5633ada85117 in main /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:250:22
#31 0x7f3598e1bd8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)
#32 0x7f3598e1be3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)
#33 0x5633ad9c4c14 in _start (/AFLplusplus/aflplusplus_pro/programs_newest_version/unibench_asan/mp42aac+0x63c14) (BuildId: d3b8e8ad63eabb5524a237d90ab6b3255af5917e)
0x602000000094 is located 0 bytes to the right of 4-byte region [0x602000000090,0x602000000094)
allocated by thread T0 here:
#0 0x5633ada8293d in operator new[](unsigned long) (/AFLplusplus/aflplusplus_pro/programs_newest_version/unibench_asan/mp42aac+0x12193d) (BuildId: d3b8e8ad63eabb5524a237d90ab6b3255af5917e)
#1 0x5633adbe978b in AP4_Stz2Atom::AP4_Stz2Atom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:101:29
#2 0x5633adbe91bd in AP4_Stz2Atom::Create(unsigned int, AP4_ByteStream&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:52:16
#3 0x5633adb126b1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:483:20
#4 0x5633adb0efa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#5 0x5633adb526a3 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#6 0x5633adb51929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#7 0x5633adb51929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#8 0x5633adb11383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#9 0x5633adb0efa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#10 0x5633adb52857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#11 0x5633adb51929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#12 0x5633adb51929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#13 0x5633adb11383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#14 0x5633adb0efa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#15 0x5633adb52857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#16 0x5633adb524e6 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
SUMMARY: AddressSanitizer: heap-buffer-overflow /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Utils.h:113:22 in AP4_BytesToUInt16BE(unsigned char const*)
Shadow bytes around the buggy address:
0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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 00 00
=>0x0c047fff8010: fa fa[04]fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8040: fa fa fa fa fa fa fa 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
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
==36796==ABORTING
```
# BUG2
```
(base) ./mp42aac POC2 /dev/null
==24898==ERROR: AddressSanitizer: requested allocation size 0xffffffffff020037 (0xffffffffff021038 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0)
#0 0x555ad6e8b93d in operator new[](unsigned long) (/AFLplusplus/aflplusplus_pro/programs_newest_version/unibench_asan/mp42aac+0x12193d) (BuildId: d3b8e8ad63eabb5524a237d90ab6b3255af5917e)
#1 0x555ad6fd6e64 in AP4_RtpAtom::AP4_RtpAtom(unsigned int, AP4_ByteStream&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4RtpAtom.cpp:50:25
==24898==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: allocation-size-too-big (/AFLplusplus/aflplusplus_pro/programs_newest_version/unibench_asan/mp42aac+0x12193d) (BuildId: d3b8e8ad63eabb5524a237d90ab6b3255af5917e) in operator new[](unsigned long)
==24898==ABORTING
```
# BUG3
```
(base) ./mp42aac POC3 /dev/null
==106460==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000000f1 at pc 0x56034caaf165 bp 0x7ffdc3d68850 sp 0x7ffdc3d68848
READ of size 1 at 0x6020000000f1 thread T0
#0 0x56034caaf164 in AP4_BytesToUInt16BE(unsigned char const*) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Utils.h:114:22
#1 0x56034caaf164 in AP4_Stz2Atom::AP4_Stz2Atom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:128:32
#2 0x56034caae1bd in AP4_Stz2Atom::Create(unsigned int, AP4_ByteStream&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:52:16
#3 0x56034c9d76b1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:483:20
#4 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#5 0x56034ca17857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#6 0x56034ca16929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#7 0x56034ca16929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#8 0x56034c9d6383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#9 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#10 0x56034ca3e893 in AP4_DrefAtom::AP4_DrefAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4DrefAtom.cpp:84:16
#11 0x56034ca3e1c5 in AP4_DrefAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4DrefAtom.cpp:50:16
#12 0x56034c9d7121 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:580:20
#13 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#14 0x56034ca176a3 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#15 0x56034ca16929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#16 0x56034ca16929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#17 0x56034c9d6383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#18 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#19 0x56034ca17857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#20 0x56034ca16929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#21 0x56034ca16929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#22 0x56034c9d6383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#23 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#24 0x56034ca17857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#25 0x56034ca16929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#26 0x56034ca16929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#27 0x56034c9d6383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#28 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#29 0x56034ca17857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#30 0x56034ca174e6 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#31 0x56034c99435d in AP4_TrakAtom::AP4_TrakAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4TrakAtom.cpp:165:5
#32 0x56034c9d82ea in AP4_TrakAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4TrakAtom.h:58:20
#33 0x56034c9d6f73 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:413:20
#34 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#35 0x56034ca17857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#36 0x56034ca174e6 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#37 0x56034c958f3f in AP4_MoovAtom::AP4_MoovAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4MoovAtom.cpp:79:5
#38 0x56034c9d824a in AP4_MoovAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4MoovAtom.h:56:20
#39 0x56034c9d7255 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:393:20
#40 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#41 0x56034c9d35f6 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#42 0x56034c9555fe in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4File.cpp:104:12
#43 0x56034c955c12 in AP4_File::AP4_File(AP4_ByteStream&, bool) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4File.cpp:78:5
#44 0x56034c94a117 in main /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:250:22
#45 0x7f9142f94d8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)
#46 0x7f9142f94e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)
#47 0x56034c889c14 in _start (/AFLplusplus/aflplusplus_pro/programs_newest_version/unibench_asan/mp42aac+0x63c14) (BuildId: d3b8e8ad63eabb5524a237d90ab6b3255af5917e)
0x6020000000f1 is located 0 bytes to the right of 1-byte region [0x6020000000f0,0x6020000000f1)
allocated by thread T0 here:
#0 0x56034c94793d in operator new[](unsigned long) (/AFLplusplus/aflplusplus_pro/programs_newest_version/unibench_asan/mp42aac+0x12193d) (BuildId: d3b8e8ad63eabb5524a237d90ab6b3255af5917e)
#1 0x56034caae78b in AP4_Stz2Atom::AP4_Stz2Atom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:101:29
#2 0x56034caae1bd in AP4_Stz2Atom::Create(unsigned int, AP4_ByteStream&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Stz2Atom.cpp:52:16
#3 0x56034c9d76b1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:483:20
#4 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#5 0x56034ca17857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#6 0x56034ca16929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#7 0x56034ca16929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#8 0x56034c9d6383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#9 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#10 0x56034ca3e893 in AP4_DrefAtom::AP4_DrefAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4DrefAtom.cpp:84:16
#11 0x56034ca3e1c5 in AP4_DrefAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4DrefAtom.cpp:50:16
#12 0x56034c9d7121 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:580:20
#13 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#14 0x56034ca176a3 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#15 0x56034ca16929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#16 0x56034ca16929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#17 0x56034c9d6383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#18 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#19 0x56034ca17857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#20 0x56034ca16929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#21 0x56034ca16929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#22 0x56034c9d6383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#23 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#24 0x56034ca17857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#25 0x56034ca16929 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#26 0x56034ca16929 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#27 0x56034c9d6383 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#28 0x56034c9d3fa4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#29 0x56034ca17857 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#30 0x56034ca174e6 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
SUMMARY: AddressSanitizer: heap-buffer-overflow /AFLplusplus/kbench_aflplusplus_images/unibench_2022_10_13_version/unibench/Bento4/Source/C++/Core/Ap4Utils.h:114:22 in AP4_BytesToUInt16BE(unsigned char const*)
Shadow bytes around the buggy address:
0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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 00 00
=>0x0c047fff8010: fa fa 04 fa fa fa 00 fa fa fa 04 fa fa fa[01]fa
0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8040: fa fa fa fa fa fa fa 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
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
==106460==ABORTING
```
# POC
[mp42aac_POC.zip](https://github.com/axiomatic-systems/Bento4/files/9796660/mp42aac_POC.zip)
| Bug Report | https://api.github.com/repos/axiomatic-systems/Bento4/issues/797/comments | 0 | 2022-10-17T03:32:34Z | 2023-05-29T02:49:33Z | https://github.com/axiomatic-systems/Bento4/issues/797 | 1,410,832,365 | 797 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hello, I use my fuzzer to fuzz binary mp42hevc , the binary all crashede, and shows that allocator is out of memory trying to allocate 0xxxxxxx bytes. Then I use the crash input to test binary mpesplit and mp4tag,and all crashed beacuse of same reason. Here are the details.
# Bug1
```
root@5f771a7e5624:/mp42hevc# /Bento4_new/Bento4-master/cmakebuild/mp42hevc poc1 /dev/null
=================================================================
==2705664==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0xc0c0c0c00 bytes
#0 0x4f44d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x60ed75 in AP4_Array<AP4_TfraAtom::Entry>::EnsureCapacity(unsigned int) /Bento4_new/Bento4-master/Source/C++/Core/Ap4Array.h:172:25
#2 0x60ed75 in AP4_Array<AP4_TfraAtom::Entry>::SetItemCount(unsigned int) /Bento4_new/Bento4-master/Source/C++/Core/Ap4Array.h:210:25
#3 0x60ed75 in AP4_TfraAtom::AP4_TfraAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4TfraAtom.cpp:88:15
#4 0x60e87f in AP4_TfraAtom::Create(unsigned int, AP4_ByteStream&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4TfraAtom.cpp:53:16
#5 0x5666e3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:443:20
#6 0x564524 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x563d4e in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#8 0x50190e in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /Bento4_new/Bento4-master/Source/C++/Core/Ap4File.cpp:104:12
#9 0x501ded in AP4_File::AP4_File(AP4_ByteStream&, bool) /Bento4_new/Bento4-master/Source/C++/Core/Ap4File.cpp:78:5
#10 0x4f7f61 in main /Bento4_new/Bento4-master/Source/C++/Apps/Mp42Hevc/Mp42Hevc.cpp:374:32
#11 0x7fdfcad7fc86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
==2705664==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99 in operator new(unsigned long)
==2705664==ABORTING
root@5f771a7e5624:/mp42hevc# /Bento4_new/Bento4-master/cmakebuild/mp42hevc poc2 /dev/null
```
```
root@5f771a7e5624:/mp42hevc# /Bento4_new/Bento4-master/cmakebuild/mp42hevc poc2 /dev/null
=================================================================
==2707985==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0xe6e8e6c60 bytes
#0 0x4f44d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x60ed75 in AP4_Array<AP4_TfraAtom::Entry>::EnsureCapacity(unsigned int) /Bento4_new/Bento4-master/Source/C++/Core/Ap4Array.h:172:25
#2 0x60ed75 in AP4_Array<AP4_TfraAtom::Entry>::SetItemCount(unsigned int) /Bento4_new/Bento4-master/Source/C++/Core/Ap4Array.h:210:25
#3 0x60ed75 in AP4_TfraAtom::AP4_TfraAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4TfraAtom.cpp:88:15
#4 0x60e87f in AP4_TfraAtom::Create(unsigned int, AP4_ByteStream&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4TfraAtom.cpp:53:16
#5 0x5666e3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:443:20
#6 0x564524 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x598cc5 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#8 0x597ef1 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#9 0x597ef1 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#10 0x565d2f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#11 0x564524 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#12 0x598cc5 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#13 0x597ef1 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#14 0x597ef1 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#15 0x565d2f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#16 0x564524 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#17 0x598cc5 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#18 0x597ef1 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#19 0x597ef1 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
#20 0x565d2f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:816:20
#21 0x564524 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#22 0x598cc5 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#23 0x598926 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:139:5
#24 0x564524 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#25 0x563d4e in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#26 0x50190e in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /Bento4_new/Bento4-master/Source/C++/Core/Ap4File.cpp:104:12
#27 0x501ded in AP4_File::AP4_File(AP4_ByteStream&, bool) /Bento4_new/Bento4-master/Source/C++/Core/Ap4File.cpp:78:5
#28 0x4f7f61 in main /Bento4_new/Bento4-master/Source/C++/Apps/Mp42Hevc/Mp42Hevc.cpp:374:32
#29 0x7f8937d8bc86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
==2707985==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99 in operator new(unsigned long)
==2707985==ABORTING
```
# Bug2
```
root@5f771a7e5624:/mp42hevc# /Bento4-1.6.0-639/cmakebuild/mp42hevc poc3 /dev/null
=================================================================
==1991469==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x400000008 bytes
#0 0x4f44d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5f50f9 in AP4_Array<unsigned long long>::EnsureCapacity(unsigned int) /Bento4-1.6.0-639/Source/C++/Core/Ap4Array.h:172:25
#2 0x5f50f9 in AP4_Array<unsigned long long>::SetItemCount(unsigned int) /Bento4-1.6.0-639/Source/C++/Core/Ap4Array.h:210:25
#3 0x5f50f9 in AP4_SaioAtom::AP4_SaioAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /Bento4-1.6.0-639/Source/C++/Core/Ap4SaioAtom.cpp:113:15
#4 0x5f4325 in AP4_SaioAtom::Create(unsigned int, AP4_ByteStream&) /Bento4-1.6.0-639/Source/C++/Core/Ap4SaioAtom.cpp:52:16
#5 0x566823 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4-1.6.0-639/Source/C++/Core/Ap4AtomFactory.cpp:714:20
#6 0x564434 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4-1.6.0-639/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x563c5e in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /Bento4-1.6.0-639/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#8 0x50190e in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /Bento4-1.6.0-639/Source/C++/Core/Ap4File.cpp:104:12
#9 0x501ded in AP4_File::AP4_File(AP4_ByteStream&, bool) /Bento4-1.6.0-639/Source/C++/Core/Ap4File.cpp:78:5
#10 0x4f7f61 in main /Bento4-1.6.0-639/Source/C++/Apps/Mp42Hevc/Mp42Hevc.cpp:374:32
#11 0x7fa18833cc86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
==1991469==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99 in operator new(unsigned long)
==1991469==ABORTING
root@5f771a7e5624:/mp42hevc# /Bento4_new/Bento4-master/cmakebuild/mp42hevc poc3 /dev/null
=================================================================
==1992701==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x400000008 bytes
#0 0x4f44d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5f5559 in AP4_Array<unsigned long long>::EnsureCapacity(unsigned int) /Bento4_new/Bento4-master/Source/C++/Core/Ap4Array.h:172:25
#2 0x5f5559 in AP4_Array<unsigned long long>::SetItemCount(unsigned int) /Bento4_new/Bento4-master/Source/C++/Core/Ap4Array.h:210:25
#3 0x5f5559 in AP4_SaioAtom::AP4_SaioAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4SaioAtom.cpp:113:15
#4 0x5f4785 in AP4_SaioAtom::Create(unsigned int, AP4_ByteStream&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4SaioAtom.cpp:52:16
#5 0x566913 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:714:20
#6 0x564524 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x563d4e in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#8 0x50190e in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /Bento4_new/Bento4-master/Source/C++/Core/Ap4File.cpp:104:12
#9 0x501ded in AP4_File::AP4_File(AP4_ByteStream&, bool) /Bento4_new/Bento4-master/Source/C++/Core/Ap4File.cpp:78:5
#10 0x4f7f61 in main /Bento4_new/Bento4-master/Source/C++/Apps/Mp42Hevc/Mp42Hevc.cpp:374:32
#11 0x7ff1c49f4c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
==1992701==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99 in operator new(unsigned long)
==1992701==ABORTING
```
# Bug3
```
root@5f771a7e5624:/mp42hevc# /Bento4_new/Bento4-master/cmakebuild/mp42hevc poc4 /dev/null
=================================================================
==2037741==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x30bb31a18 bytes
#0 0x4f44d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5fb1ad in AP4_Array<AP4_SbgpAtom::Entry>::EnsureCapacity(unsigned int) /Bento4_new/Bento4-master/Source/C++/Core/Ap4Array.h:172:25
#2 0x5fb1ad in AP4_Array<AP4_SbgpAtom::Entry>::SetItemCount(unsigned int) /Bento4_new/Bento4-master/Source/C++/Core/Ap4Array.h:210:25
#3 0x5fb1ad in AP4_SbgpAtom::AP4_SbgpAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4SbgpAtom.cpp:90:15
#4 0x5fadc5 in AP4_SbgpAtom::Create(unsigned int, AP4_ByteStream&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4SbgpAtom.cpp:52:16
#5 0x56621d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:744:20
#6 0x564524 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x598a7c in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /Bento4_new/Bento4-master/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#8 0x52401d in AP4_VisualSampleEntry::AP4_VisualSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4_new/Bento4-master/Source/C++/Core/Ap4SampleEntry.cpp:884:5
==2037741==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99 in operator new(unsigned long)
==2037741==ABORTING
root@5f771a7e5624:/mp42hevc# /Bento4-1.6.0-639/cmakebuild/mp42hevc poc4 /dev/null
=================================================================
==2038956==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x30bb31a18 bytes
#0 0x4f44d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5fad4d in AP4_Array<AP4_SbgpAtom::Entry>::EnsureCapacity(unsigned int) /Bento4-1.6.0-639/Source/C++/Core/Ap4Array.h:172:25
#2 0x5fad4d in AP4_Array<AP4_SbgpAtom::Entry>::SetItemCount(unsigned int) /Bento4-1.6.0-639/Source/C++/Core/Ap4Array.h:210:25
#3 0x5fad4d in AP4_SbgpAtom::AP4_SbgpAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /Bento4-1.6.0-639/Source/C++/Core/Ap4SbgpAtom.cpp:90:15
#4 0x5fa965 in AP4_SbgpAtom::Create(unsigned int, AP4_ByteStream&) /Bento4-1.6.0-639/Source/C++/Core/Ap4SbgpAtom.cpp:52:16
#5 0x56612d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4-1.6.0-639/Source/C++/Core/Ap4AtomFactory.cpp:744:20
#6 0x564434 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4-1.6.0-639/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x59854c in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /Bento4-1.6.0-639/Source/C++/Core/Ap4ContainerAtom.cpp:194:12
#8 0x523fbd in AP4_VisualSampleEntry::AP4_VisualSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4-1.6.0-639/Source/C++/Core/Ap4SampleEntry.cpp:884:5
==2038956==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99 in operator new(unsigned long)
==2038956==ABORTING
```
# Environment
clang 12.0.1
clang++ 12.0.1
version branch([5e7bb34](https://github.com/axiomatic-systems/Bento4/commit/5e7bb34a08272c49242196eba1cefab8af55f381)) && version [v1.6.0-639](https://github.com/axiomatic-systems/Bento4/releases/tag/v1.6.0-639)
# How to reproduce
```
export CC=clang
export CXX=clang++
export CFLAGS="-fsanitize=address -g"
export CXXFLAGS="-fsanitize=address -g"
mkdir cmakebuild
cd cmakebuild
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
# POC
[crash.zip](https://github.com/axiomatic-systems/Bento4/files/9783874/crash.zip)
# Credit
Yuhang Huang ([NCNIPC of China](http://www.nipc.org.cn/))
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Yin li,Jiayu Zhao([NCNIPC of China](http://www.nipc.org.cn/)) | Out of memory when allocating memory | https://api.github.com/repos/axiomatic-systems/Bento4/issues/796/comments | 0 | 2022-10-14T03:28:06Z | 2023-05-29T02:51:51Z | https://github.com/axiomatic-systems/Bento4/issues/796 | 1,408,703,219 | 796 |
[
"axiomatic-systems",
"Bento4"
] | ## Summary
A SEGV on unknown address in `AP4_Processor::ProcessFragments` in Source/C++/Core/Ap4Processor.cpp:192. The address points to the zero page.
## Details
```
=================================================================
==27083==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55e4af1ab58f bp 0x7ffc23973200 sp 0x7ffc23972d50 T0)
==27083==The signal is caused by a READ memory access.
==27083==Hint: address points to the zero page.
#0 0x55e4af1ab58e in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&) Bento4/Source/C++/Core/Ap4Processor.cpp:285
#1 0x55e4af1b30c6 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) Bento4/Source/C++/Core/Ap4Processor.cpp:721
#2 0x55e4af0496c9 in main Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258
#3 0x7fbf8aba6c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#4 0x55e4af04d249 in _start (Bento4/mp4decrypt+0x36249)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV Bento4/Source/C++/Core/Ap4Processor.cpp:285 in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&)
==27083==ABORTING
```
## PoC
[mp4decrypt_poc.zip](https://github.com/axiomatic-systems/Bento4/files/9750526/mp4decrypt_poc.zip)
## Verification Step
```bash
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
./mp4decrypt poc /dev/null
```
## Environment
- Ubuntu 18.04
- clang 10.01
## Version
Bento4 master branch [4df7274e](https://github.com/axiomatic-systems/Bento4/commit/4df7274e5e57e6219ca1e5dbdcb99ad1f7abb743) commit and version 1.6.0-639
| SEGV on unknown address in mp4decrypt | https://api.github.com/repos/axiomatic-systems/Bento4/issues/795/comments | 0 | 2022-10-11T02:36:43Z | 2023-05-29T02:51:51Z | https://github.com/axiomatic-systems/Bento4/issues/795 | 1,403,916,020 | 795 |
[
"axiomatic-systems",
"Bento4"
] | Hello, developers of Bento4!
I also found some **heap buffer overflow** bugs in avcinfo by using our fuzzing tools with ASAN.
Here is details:
## Bug1
```
=================================================================
==48171==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000038 at pc 0x7f1ff86b4733 bp 0x7fff66ab01b0 sp 0x7fff66aaf958
READ of size 8 at 0x602000000038 thread T0
#0 0x7f1ff86b4732 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x79732)
#1 0x5638f29e7432 in AP4_BitStream::WriteBytes(unsigned char const*, unsigned int) Bento4/Source/C++/Codecs/Ap4BitStream.cpp:133
#2 0x5638f29c0c69 in PrintSliceInfo Bento4/Source/C++/Apps/AvcInfo/AvcInfo.cpp:84
#3 0x5638f29c0c69 in main Bento4/Source/C++/Apps/AvcInfo/AvcInfo.cpp:172
#4 0x7f1ff7ccac86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#5 0x5638f29c1679 in _start (Bento4/avcinfo+0x5679)
0x602000000038 is located 0 bytes to the right of 8-byte region [0x602000000030,0x602000000038)
allocated by thread T0 here:
#0 0x7f1ff871b608 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0608)
#1 0x5638f29ed326 in AP4_DataBuffer::ReallocateBuffer(unsigned int) Bento4/Source/C++/Core/Ap4DataBuffer.cpp:210
#2 0x5638f29ed326 in AP4_DataBuffer::SetDataSize(unsigned int) Bento4/Source/C++/Core/Ap4DataBuffer.cpp:151
SUMMARY: AddressSanitizer: heap-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x79732)
Shadow bytes around the buggy address:
0x0c047fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c047fff8000: fa fa fd fa fa fa 00[fa]fa fa fa fa fa fa fa fa
0x0c047fff8010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8040: fa fa fa fa fa fa fa 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
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
==48171==ABORTING
```
### Poc
[avcinfo_poc1.zip](https://github.com/axiomatic-systems/Bento4/files/9746288/avcinfo_poc1.zip)
## Bug2
```
=================================================================
==48988==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000011 at pc 0x561df275ee6e bp 0x7ffca5855570 sp 0x7ffca5855560
READ of size 1 at 0x602000000011 thread T0
#0 0x561df275ee6d in main Bento4/Source/C++/Apps/AvcInfo/AvcInfo.cpp:166
#1 0x7f9a9fbd8c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#2 0x561df275f679 in _start (Bento4/avcinfo+0x5679)
0x602000000011 is located 0 bytes to the right of 1-byte region [0x602000000010,0x602000000011)
allocated by thread T0 here:
#0 0x7f9aa0629608 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0608)
#1 0x561df278b326 in AP4_DataBuffer::ReallocateBuffer(unsigned int) Bento4/Source/C++/Core/Ap4DataBuffer.cpp:210
#2 0x561df278b326 in AP4_DataBuffer::SetDataSize(unsigned int) Bento4/Source/C++/Core/Ap4DataBuffer.cpp:151
SUMMARY: AddressSanitizer: heap-buffer-overflow Bento4/Source/C++/Apps/AvcInfo/AvcInfo.cpp:166 in main
Shadow bytes around the buggy address:
0x0c047fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c047fff8000: fa fa[01]fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8040: fa fa fa fa fa fa fa 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
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
==48988==ABORTING
```
### PoC
[avcinfo_poc2.zip](https://github.com/axiomatic-systems/Bento4/files/9746311/avcinfo_poc2.zip)
## 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
./avcinfo poc
```
## Environment
- Ubuntu 18.04
- clang 10.01
- Bento4 master branch [4df7274e](https://github.com/axiomatic-systems/Bento4/commit/4df7274e5e57e6219ca1e5dbdcb99ad1f7abb743) commit and version 1.6.0-639
Thanks for your time! | Some heap buffer overflow bugs exist in avcinfo | https://api.github.com/repos/axiomatic-systems/Bento4/issues/794/comments | 0 | 2022-10-10T13:34:03Z | 2023-05-29T02:51:50Z | https://github.com/axiomatic-systems/Bento4/issues/794 | 1,403,189,077 | 794 |
[
"axiomatic-systems",
"Bento4"
] | Hello, developers of Bento4. I found a heap use after free bug in AP4_LinearReader::Advance(bool) with ASAN.
The following is the details.
### Details
```
=================================================================
==32056==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000001f98 at pc 0x56093865ee11 bp 0x7ffea5a93280 sp 0x7ffea5a93270
READ of size 8 at 0x604000001f98 thread T0
#0 0x56093865ee10 in AP4_LinearReader::Advance(bool) Bento4/Source/C++/Core/Ap4LinearReader.cpp:434
#1 0x560938666716 in AP4_LinearReader::ReadNextSample(unsigned int, AP4_Sample&, AP4_DataBuffer&) Bento4/Source/C++/Core/Ap4LinearReader.cpp:530
#2 0x5609386402ea in ReadSample Bento4/Source/C++/Apps/Mp42Ts/Mp42Ts.cpp:181
#3 0x56093863a518 in WriteSamples Bento4/Source/C++/Apps/Mp42Ts/Mp42Ts.cpp:306
#4 0x56093863a518 in main Bento4/Source/C++/Apps/Mp42Ts/Mp42Ts.cpp:638
#5 0x7f8ea7badc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#6 0x56093863f9d9 in _start (Bento4/mp42ts+0x3a9d9)
0x604000001f98 is located 8 bytes inside of 48-byte region [0x604000001f90,0x604000001fc0)
freed by thread T0 here:
#0 0x7f8ea899d9c8 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe19c8)
#1 0x56093865e49f in AP4_LinearReader::SampleBuffer::~SampleBuffer() Bento4/Source/C++/Core/Ap4LinearReader.h:104
#2 0x56093865e49f in AP4_LinearReader::Advance(bool) Bento4/Source/C++/Core/Ap4LinearReader.cpp:462
previously allocated by thread T0 here:
#0 0x7f8ea899c448 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0448)
#1 0x56093865ddb9 in AP4_LinearReader::Advance(bool) Bento4/Source/C++/Core/Ap4LinearReader.cpp:422
SUMMARY: AddressSanitizer: heap-use-after-free Bento4/Source/C++/Core/Ap4LinearReader.cpp:434 in AP4_LinearReader::Advance(bool)
Shadow bytes around the buggy address:
0x0c087fff83a0: fa fa fd fd fd fd fd fd fa fa fd fd fd fd fd fa
0x0c087fff83b0: fa fa fd fd fd fd fd fd fa fa fd fd fd fd fd fa
0x0c087fff83c0: fa fa fd fd fd fd fd fd fa fa fd fd fd fd fd fa
0x0c087fff83d0: fa fa fd fd fd fd fd fd fa fa fd fd fd fd fd fa
0x0c087fff83e0: fa fa fd fd fd fd fd fd fa fa fd fd fd fd fd fa
=>0x0c087fff83f0: fa fa fd[fd]fd fd fd fd fa fa fd fd fd fd fd fa
0x0c087fff8400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff8410: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff8420: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff8430: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff8440: 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
==32056==ABORTING
```
### PoC
[mp42ts_poc.zip](https://github.com/axiomatic-systems/Bento4/files/9744391/mp42ts_poc.zip)
### 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
./mp42ts poc /dev/null
```
### Enviroment
- Ubuntu 18.04
- clang 10.01
- Bento4 master branch [4df7274e](https://github.com/axiomatic-systems/Bento4/commit/4df7274e5e57e6219ca1e5dbdcb99ad1f7abb743) commit and version 1.6.0-639
| heap-use-after-free bug in mp42ts | https://api.github.com/repos/axiomatic-systems/Bento4/issues/793/comments | 0 | 2022-10-10T08:51:58Z | 2023-05-29T02:51:21Z | https://github.com/axiomatic-systems/Bento4/issues/793 | 1,402,818,781 | 793 |
[
"axiomatic-systems",
"Bento4"
] | # **Summary**
Hi, developers of Bento4,
I tested the binary of bento4 with my fuzzer, and some memory-leak crashes incurred. Among them, Bug3-5 may be different from #771. The operation system is Ubuntu 18.04.6 LTS (docker), these crashes with the following.
# **Bug1**
Detected memory leaks in mp4encrypt, the bug may be different from #766.
```
root@q10s3kl5mn:/fuzz-mp4encrypt/mp4encrypt# ./mp4encrypt --method OMA-PDCF-CBC POC_mp4encrypt_631000973 /dev/null
WARNING: track ID 3 will not be encrypted
WARNING: track ID 4 will not be encrypted
WARNING: track ID 1 will not be encrypted
WARNING: track ID 2 will not be encrypted
WARNING: atom serialized to fewer bytes than declared size
WARNING: atom serialized to fewer bytes than declared size
=================================================================
==586357==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 144 byte(s) in 2 object(s) allocated from:
#0 0x9a1c90 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f40270a9297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x556c32 in AP4_EsdsAtom::Create(unsigned int, AP4_ByteStream&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x556c32)
#3 0x43aae6 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x43aae6)
#4 0x449406 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x449406)
#5 0x51be85 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x51be85)
#6 0x42e842 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x42e842)
#7 0x449406 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x449406)
#8 0x722218 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x722218)
#9 0x7215b2 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x7215b2)
#10 0x439d76 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x439d76)
#11 0x449406 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x449406)
#12 0x51be85 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x51be85)
#13 0x51b62a in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x51b62a)
#14 0x4438e4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x4438e4)
#15 0x449406 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x449406)
#16 0x51be85 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x51be85)
#17 0x51b62a in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x51b62a)
#18 0x4438e4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x4438e4)
#19 0x449406 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x449406)
#20 0x51be85 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x51be85)
#21 0x51b62a in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x51b62a)
#22 0x4438e4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x4438e4)
#23 0x449406 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x449406)
#24 0x51be85 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x51be85)
#25 0x51e13b in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x51e13b)
SUMMARY: AddressSanitizer: 144 byte(s) leaked in 2 allocation(s).
```
# **Bug2**
Detected memory leaks in mp4edit, the bug may be different from #776.
```
root@q11s3kl5mn:/fuzz-mp4edit/mp4edit# ./mp4edit POC_mp4edit_728838793 /dev/null
WARNING: atom serialized to fewer bytes than declared size
WARNING: atom serialized to fewer bytes than declared size
WARNING: atom serialized to fewer bytes than declared size
WARNING: padding would be too large
WARNING: atom serialized to fewer bytes than declared size
WARNING: padding would be too large
WARNING: atom serialized to fewer bytes than declared size
WARNING: atom serialized to fewer bytes than declared size
WARNING: atom serialized to fewer bytes than declared size
WARNING: padding would be too large
WARNING: atom serialized to fewer bytes than declared size
WARNING: padding would be too large
=================================================================
==91239==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 72 byte(s) in 1 object(s) allocated from:
#0 0x8eaf60 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f3c0c690297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c1886 in AP4_EsdsAtom::Create(unsigned int, AP4_ByteStream&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4c1886)
#3 0x4552db in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4552db)
#4 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#5 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#6 0x5d7069 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x5d7069)
#7 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#8 0x62020e in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x62020e)
#9 0x61f694 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x61f694)
#10 0x4546d3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4546d3)
#11 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#12 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#13 0x48d616 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x48d616)
#14 0x45cb77 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45cb77)
#15 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#16 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#17 0x48d616 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x48d616)
#18 0x45cb77 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45cb77)
#19 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#20 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#21 0x48d616 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x48d616)
#22 0x45cb77 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45cb77)
#23 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#24 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#25 0x48fb01 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x48fb01)
Direct leak of 72 byte(s) in 1 object(s) allocated from:
#0 0x8eaf60 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f3c0c690297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c1886 in AP4_EsdsAtom::Create(unsigned int, AP4_ByteStream&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4c1886)
#3 0x4552db in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4552db)
#4 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#5 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#6 0x5d7069 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x5d7069)
#7 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#8 0x62020e in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x62020e)
#9 0x61f694 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x61f694)
#10 0x4546d3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4546d3)
#11 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#12 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#13 0x48d616 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x48d616)
#14 0x45cb77 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45cb77)
#15 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#16 0x4b6440 in AP4_DrefAtom::AP4_DrefAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4b6440)
#17 0x4b5af8 in AP4_DrefAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4b5af8)
#18 0x456f8a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x456f8a)
#19 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#20 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#21 0x48d616 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x48d616)
#22 0x45cb77 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45cb77)
#23 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#24 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#25 0x48d616 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x48d616)
#26 0x45cb77 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45cb77)
#27 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#28 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#29 0x48d616 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x48d616)
SUMMARY: AddressSanitizer: 144 byte(s) leaked in 2 allocation(s).
```
# **Bug3**
Detected memory leaks in mp4decrypt.
```
root@34f1181t281a:/fuzz-mp4decrypt/mp4decrypt# ./mp4decrypt POC_mp4decrypt_477546304 /dev/null
WARNING: atom serialized to fewer bytes than declared size
=================================================================
==203693==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x8f7da0 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fd288f7b297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x42ffef in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42ffef)
#3 0x5e6b75 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x5e6b75)
#4 0x414e8b in main (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x414e8b)
#5 0x7fd288900c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Direct leak of 48 byte(s) in 1 object(s) allocated from:
#0 0x8f7da0 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fd288f7b297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x423f9d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x423f9d)
#3 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#4 0x42ffef in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42ffef)
#5 0x5e6b75 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x5e6b75)
#6 0x414e8b in main (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x414e8b)
#7 0x7fd288900c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 192 byte(s) in 1 object(s) allocated from:
#0 0x8f7da0 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fd288f7b297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4324cf in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4324cf)
#3 0x42ffef in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42ffef)
#4 0x5e6b75 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x5e6b75)
#5 0x414e8b in main (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x414e8b)
#6 0x7fd288900c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: 328 byte(s) leaked in 3 allocation(s).
```
# **Bug4**
Detected memory leaks in mp4decrypt.
```
root@34f1181t281a:/fuzz-mp4decrypt/mp4decrypt# ./mp4decrypt POC_mp4decrypt_34393864 /dev/null
WARNING: atom serialized to fewer bytes than declared size
=================================================================
==52857==ERROR: LeakSanitizer: detected memory leaks
Indirect leak of 1376 byte(s) in 1 object(s) allocated from:
#0 0x8f7da0 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fd58b6db297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x6f392d in AP4_TrunAtom::Create(unsigned int, AP4_ByteStream&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x6f392d)
#3 0x423d35 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x423d35)
#4 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#5 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#6 0x4eab86 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eab86)
#7 0x42d270 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42d270)
#8 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#9 0x42ffef in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42ffef)
#10 0x5e6b75 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x5e6b75)
#11 0x414e8b in main (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x414e8b)
#12 0x7fd58b060c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
…… ……
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
#0 0x8f7da0 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fd58b6db297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x42aca3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42aca3)
#3 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#4 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#5 0x4eab86 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eab86)
#6 0x42d270 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42d270)
#7 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#8 0x42ffef in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42ffef)
#9 0x5e6b75 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x5e6b75)
#10 0x414e8b in main (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x414e8b)
#11 0x7fd58b060c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: 1720 byte(s) leaked in 8 allocation(s).
```
# **Bug5**
Detected memory leaks in mp4decrypt.
```
root@34f1181t281a:/fuzz-mp4decrypt/mp4decrypt# ./mp4decrypt POC_mp4decrypt_654515280 /dev/null
WARNING: atom serialized to fewer bytes than declared size
WARNING: atom serialized to fewer bytes than declared size
LLVMSymbolizer: error reading file: No such file or directory
=================================================================
==197884==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 264 byte(s) in 3 object(s) allocated from:
#0 0x8f7da0 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f0c66e06297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x51e986 in AP4_EsdsAtom::Create(unsigned int, AP4_ByteStream&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x51e986)
#3 0x424e14 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x424e14)
#4 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#5 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#6 0x661689 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x661689)
#7 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#8 0x6aa85e in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x6aa85e)
#9 0x6a9ce4 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x6a9ce4)
#10 0x42420c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42420c)
#11 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#12 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#13 0x4eab86 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eab86)
#14 0x42d270 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42d270)
#15 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#16 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#17 0x4eab86 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eab86)
#18 0x42d270 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42d270)
#19 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#20 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#21 0x4eab86 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eab86)
#22 0x42d270 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42d270)
#23 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#24 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#25 0x4ed071 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4ed071)
…… ……
Direct leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x8f7da0 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f0c66e06297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x51e986 in AP4_EsdsAtom::Create(unsigned int, AP4_ByteStream&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x51e986)
#3 0x424e14 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x424e14)
#4 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#5 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#6 0x661689 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x661689)
#7 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#8 0x6aa85e in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x6aa85e)
#9 0x6a9ce4 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x6a9ce4)
#10 0x42420c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42420c)
#11 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#12 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#13 0x4eab86 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eab86)
#14 0x42d270 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42d270)
#15 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#16 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#17 0x4eab86 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eab86)
#18 0x42d270 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42d270)
#19 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#20 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#21 0x4eab86 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eab86)
#22 0x42d270 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x42d270)
#23 0x4320af in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4320af)
#24 0x4eb387 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4eb387)
#25 0x4ed071 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x4ed071)
#26 0x7fff0fa80e9f ([stack]+0x18e9f)
SUMMARY: AddressSanitizer: 352 byte(s) leaked in 4 allocation(s).
```
# **Bug6**
```
root@34f1181t281a:/fuzz-mp4mux# ./../Bento4-1.6.0-639/cmakebuild/mp4mux --track h264:POC_mp4mux_1729452038 /dev/null
ERROR: no sequence parameter set found in video
=================================================================
==4079790==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 104 byte(s) in 1 object(s) allocated from:
#0 0x4f5ce8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x4fdd99 in main (/Bento4-1.6.0-639/cmakebuild/mp4mux+0x4fdd99)
#2 0x7f3d73ac9c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: 104 byte(s) leaked in 1 allocation(s).
root@26c10857b81a:/fuzz-mp4mux# ./../Bento4-1.6.0-639/cmakebuild/mp4mux --track h265:in/3.mp4 /dev/null
ERROR: no sequence parameter set found in video
```
# **POC**
[POC_mp4encrypt_631000973.zip](https://github.com/axiomatic-systems/Bento4/files/9726934/POC_mp4encrypt_631000973.zip)
[POC_mp4edit_728838793.zip](https://github.com/axiomatic-systems/Bento4/files/9726974/POC_mp4edit_728838793.zip)
[POC_mp4decrypt_477546304.zip](https://github.com/axiomatic-systems/Bento4/files/9727002/POC_mp4decrypt_477546304.zip)
[POC_mp4decrypt_34393864.zip](https://github.com/axiomatic-systems/Bento4/files/9727048/POC_mp4decrypt_34393864.zip)
[POC_mp4decrypt_654515280.zip](https://github.com/axiomatic-systems/Bento4/files/9727059/POC_mp4decrypt_654515280.zip)
[POC_mp4mux_1729452038.zip](https://github.com/axiomatic-systems/Bento4/files/9727057/POC_mp4mux_1729452038.zip)
# **Environment**
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# **Credit**
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/)), (Zhongguancun Laboratory)
Jiayuan Zhang ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Zezhong Ren ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Thank you for your time! | Some Memory leaks exist in mp4xx | https://api.github.com/repos/axiomatic-systems/Bento4/issues/792/comments | 0 | 2022-10-06T17:14:56Z | 2023-06-26T05:55:54Z | https://github.com/axiomatic-systems/Bento4/issues/792 | 1,400,040,986 | 792 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hi, developers of Bento4:
I tested the binary mp42hevc with my fuzzer, and a crash incurred—SEGV on unknown address in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool). The following is the details.
# Bug
Detected SEGV on unknown address in AP4_File::ParseStream.
```
root@2e47aa8b3277:/# ./Bento4/cmakebuild/mp42hevc POC_mp42hevc_1 /dev/null
ERROR: cannot open input (-4)
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2297862==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000005029ca bp 0x7ffda4602cd0 sp 0x7ffda4602ba0 T0)
==2297862==The signal is caused by a READ memory access.
==2297862==Hint: address points to the zero page.
#0 0x5029ca in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) (/Bento4/cmakebuild/mp42hevc+0x5029ca)
#1 0x503176 in AP4_File::AP4_File(AP4_ByteStream&, bool) (/Bento4/cmakebuild/mp42hevc+0x503176)
#2 0x4f95fe in main (/Bento4/cmakebuild/mp42hevc+0x4f95fe)
#3 0x7f76d743ec86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#4 0x41d999 in _start (/Bento4/cmakebuild/mp42hevc+0x41d999)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/Bento4/cmakebuild/mp42hevc+0x5029ca) in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool)
==2297862==ABORTING
```
# POC
[POC_mp42hevc_1.zip](https://github.com/axiomatic-systems/Bento4/files/9709839/POC_mp42hevc_1.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/))
Jiayuan Zhang ([NCNIPC of China](http://www.nipc.org.cn/))
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Thank you for your time! | SEGV on unknown address in mp42hevc | https://api.github.com/repos/axiomatic-systems/Bento4/issues/791/comments | 0 | 2022-10-04T19:04:07Z | 2022-10-05T04:59:59Z | https://github.com/axiomatic-systems/Bento4/issues/791 | 1,396,719,593 | 791 |
[
"axiomatic-systems",
"Bento4"
] | Hey,
I'm having trouble generating a hls stream with equal segment duration for audio and video.
My first step is to force keyframes on audio and video files every 2 seconds with `ffmpeg`.
```
ffmpeg -t $duration -i original.mp4 -c:v libx264 -an -vf "scale=-1:1080" -b:v 6M -force_key_frames 'expr:gte(t,n_forced*'"$keyframe_interval"')' -r $fps 1080p.mp4
ffmpeg -t $duration -i original.mp4 -c:a aac -vn -force_key_frames 'expr:gte(t,n_forced*'"$keyframe_interval"')' -r $fps audio_1.mp4
```
Then I fragment those two files with `mp4fragment`.
```ps1
mp4fragment --fragment-duration 6000 1080p.mp4 f-1080p.mp4
mp4fragment --fragment-duration 6000 audio_1.mp4 f-audio_1.mp4
```
And finally I create my hls live stream with `mp4dash`.
```ps1
mp4dash -o stream --hls --use-segment-timeline f-1080p.mp4 f-audio_1.mp4
```
This generates the following two playlists (and other stuff of but not important here)
Audio Playlist
```
#EXTM3U
# Created with Bento4 mp4-dash.py, VERSION=2.0.0-639
#
#EXT-X-VERSION:6
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-TARGETDURATION:7
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-MAP:URI="init.mp4"
#EXTINF:5.990748299319728,
seg-1.m4s
#EXTINF:6.013968253968254,
seg-2.m4s
#EXTINF:5.990748299319728,
seg-3.m4s
....
```
Video Playlist
```
# Created with Bento4 mp4-dash.py, VERSION=2.0.0-639
#
#EXT-X-VERSION:6
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-MAP:URI="init.mp4"
#EXTINF:6.0,
seg-1.m4s
#EXTINF:6.0,
seg-2.m4s
#EXTINF:6.0,
seg-3.m4s
....
```
The problem is, that:
1. Audio and Video segments in the created playlists have not the same length. My goal is to have exactly `#EXTINF:6.0,` on every segment for video and **audio**.
2. Can I limit the or fix the digits for the segment duration. Meaning e.g. max 3 digits as segment length so `#EXTINF:6.013968253968254,` turns into `#EXTINF:6.014,`?
The first point would make the second obsolete. And I guess point 2 is not fixed by rounding the number. | Sync segment duration of audio and video stream with mp4dash | https://api.github.com/repos/axiomatic-systems/Bento4/issues/790/comments | 1 | 2022-10-04T11:24:14Z | 2023-10-01T15:19:06Z | https://github.com/axiomatic-systems/Bento4/issues/790 | 1,396,096,592 | 790 |
[
"axiomatic-systems",
"Bento4"
] | Hi, developers of Bento4:
Thanks for your fix of issue #751
In the test of the binary mp42aac instrumented with ASAN. There are some inputs causing heap-buffer-overflow. Here is the ASAN mode output. This issue may be because of an incomplete fix of #751.
=================================================================
==8242==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x619000002798 at pc 0x7f30ba3a2964 bp 0x7fff5a52d110 sp 0x7fff5a52c8b8
WRITE of size 4294967288 at 0x619000002798 thread T0
#0 0x7f30ba3a2963 in __asan_memcpy (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x8c963)
#1 0x409c09 in AP4_MemoryByteStream::WritePartial(void const*, unsigned int, unsigned int&) /root/Bento4/Source/C++/Core/Ap4ByteStream.cpp:785
#2 0x40da09 in AP4_ByteStream::Write(void const*, unsigned int) /root/Bento4/Source/C++/Core/Ap4ByteStream.cpp:77
#3 0x65a86f in AP4_SgpdAtom::WriteFields(AP4_ByteStream&) /root/Bento4/Source/C++/Core/Ap4SgpdAtom.cpp:144
#4 0x4e99bc in AP4_Atom::Write(AP4_ByteStream&) /root/Bento4/Source/C++/Core/Ap4Atom.cpp:229
#5 0x4e99bc in AP4_Atom::Clone() /root/Bento4/Source/C++/Core/Ap4Atom.cpp:316
#6 0x574024 in AP4_ContainerAtom::Clone() /root/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:172
#7 0x574024 in AP4_ContainerAtom::Clone() /root/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:172
#8 0x446e72 in AP4_SampleDescription::AP4_SampleDescription(AP4_SampleDescription::Type, unsigned int, AP4_AtomParent*) /root/Bento4/Source/C++/Core/Ap4SampleDescription.cpp:138
#9 0x460bf8 in AP4_GenericAudioSampleDescription::AP4_GenericAudioSampleDescription(unsigned int, unsigned int, unsigned short, unsigned short, AP4_AtomParent*) /root/Bento4/Source/C++/Core/Ap4SampleDescription.h:259
#10 0x460bf8 in AP4_AudioSampleEntry::ToSampleDescription() /root/Bento4/Source/C++/Core/Ap4SampleEntry.cpp:630
#11 0x4899a4 in AP4_StsdAtom::GetSampleDescription(unsigned int) /root/Bento4/Source/C++/Core/Ap4StsdAtom.cpp:181
#12 0x404135 in main /root/Bento4/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:268
#13 0x7f30b966783f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#14 0x408128 in _start (/root/Bento4/mp42aac+0x408128)
0x619000002798 is located 0 bytes to the right of 1048-byte region [0x619000002380,0x619000002798)
allocated by thread T0 here:
#0 0x7f30ba3af712 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99712)
#1 0x4151ce in AP4_DataBuffer::ReallocateBuffer(unsigned int) /root/Bento4/Source/C++/Core/Ap4DataBuffer.cpp:210
#2 0x4151ce in AP4_DataBuffer::SetBufferSize(unsigned int) /root/Bento4/Source/C++/Core/Ap4DataBuffer.cpp:136
#3 0x4151ce in AP4_DataBuffer::Reserve(unsigned int) /root/Bento4/Source/C++/Core/Ap4DataBuffer.cpp:107
SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 __asan_memcpy
Shadow bytes around the buggy address:
0x0c327fff84a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c327fff84b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c327fff84c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c327fff84d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c327fff84e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c327fff84f0: 00 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8500: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8510: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8520: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8530: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8540: 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==8242==ABORTING
### Crash input
https://github.com/17ssDP/fuzzer_crashes/blob/main/Bento4/mp42aac-hbo-01
### Validation 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
./mp42aac mp42aac-hbo-01 /dev/null
### Environment
Ubuntu 16.04
Clang 10.0.1
gcc 5.5
| Heap-buffer-overflow with ASAN in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/789/comments | 0 | 2022-10-04T06:45:46Z | 2023-05-29T02:51:19Z | https://github.com/axiomatic-systems/Bento4/issues/789 | 1,395,747,445 | 789 |
[
"axiomatic-systems",
"Bento4"
] | Hi, developers of Bento4:
In the test of the binary mp42aac instrumented with ASAN. There are some inputs causing memory leaks. Here is the ASAN mode output. The output is different from #763.
=================================================================
==6659==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x7f8d891f0592 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99592)
#1 0x418dff in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /root/Bento4/Source/C++/Core/Ap4File.cpp:108
#2 0x418dff in AP4_File::AP4_File(AP4_ByteStream&, bool) /root/Bento4/Source/C++/Core/Ap4File.cpp:78
SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s).
### Crash Input
https://github.com/17ssDP/fuzzer_crashes/blob/main/Bento4/mp42aac-ml-01
### 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
./mp42aac mp42aac-ml-01 /dev/null
### Environment
Ubuntu 16.04
Clang 10.0.1
gcc 5.5 | Memory leaks with ASAN in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/788/comments | 0 | 2022-10-04T06:40:25Z | 2023-05-29T02:51:19Z | https://github.com/axiomatic-systems/Bento4/issues/788 | 1,395,742,603 | 788 |
[
"axiomatic-systems",
"Bento4"
] | Hi, developers of Bento4:
In the test of the binary mp42ts instrumented with ASAN. There are some inputs causing heap-buffer-overflow. Here is the ASAN mode output. The output is different from #764
=================================================================
==3902==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60400000df38 at pc 0x0000004a51a6 bp 0x7ffc109910f0 sp 0x7ffc109910e0
READ of size 1 at 0x60400000df38 thread T0
#0 0x4a51a5 in AP4_BitReader::ReadCache() const /root/Bento4/Source/C++/Core/Ap4Utils.cpp:447
#1 0x4a51a5 in AP4_BitReader::ReadBits(unsigned int) /root/Bento4/Source/C++/Core/Ap4Utils.cpp:467
#2 0x5405fc in AP4_Dac4Atom::AP4_Dac4Atom(unsigned int, unsigned char const*) /root/Bento4/Source/C++/Core/Ap4Dac4Atom.cpp:313
#3 0x5423a2 in AP4_Dac4Atom::Create(unsigned int, AP4_ByteStream&) /root/Bento4/Source/C++/Core/Ap4Dac4Atom.cpp:58
#4 0x4f47c5 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /root/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:776
#5 0x4f955a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /root/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234
#6 0x51a25e in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /root/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194
#7 0x487d31 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) /root/Bento4/Source/C++/Core/Ap4SampleEntry.cpp:115
#8 0x487d31 in AP4_AudioSampleEntry::AP4_AudioSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /root/Bento4/Source/C++/Core/Ap4SampleEntry.cpp:420
#9 0x487d31 in AP4_Ac4SampleEntry::AP4_Ac4SampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /root/Bento4/Source/C++/Core/Ap4SampleEntry.cpp:801
#10 0x4f1aad in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /root/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:342
#11 0x4f955a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /root/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234
#12 0x6134a9 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /root/Bento4/Source/C++/Core/Ap4StsdAtom.cpp:101
#13 0x61534b in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /root/Bento4/Source/C++/Core/Ap4StsdAtom.cpp:57
#14 0x4f55a6 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /root/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:458
#15 0x4f955a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /root/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234
#16 0x5181d5 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /root/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:194
#17 0x5181d5 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /root/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:139
#18 0x518fce in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /root/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88
#19 0x4f2b69 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /root/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816
#20 0x4f865c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /root/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234
#21 0x4f865c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /root/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154
#22 0x41c87f in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /root/Bento4/Source/C++/Core/Ap4File.cpp:104
#23 0x41c87f in AP4_File::AP4_File(AP4_ByteStream&, bool) /root/Bento4/Source/C++/Core/Ap4File.cpp:78
#24 0x40441f in main /root/Bento4/Source/C++/Apps/Mp42Ts/Mp42Ts.cpp:511
#25 0x7fb1c343783f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#26 0x40ad98 in _start (/root/Bento4/mp42ts+0x40ad98)
0x60400000df38 is located 0 bytes to the right of 40-byte region [0x60400000df10,0x60400000df38)
allocated by thread T0 here:
#0 0x7fb1c417f712 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99712)
#1 0x4199e5 in AP4_DataBuffer::ReallocateBuffer(unsigned int) /root/Bento4/Source/C++/Core/Ap4DataBuffer.cpp:210
#2 0x4199e5 in AP4_DataBuffer::SetBufferSize(unsigned int) /root/Bento4/Source/C++/Core/Ap4DataBuffer.cpp:136
SUMMARY: AddressSanitizer: heap-buffer-overflow /root/Bento4/Source/C++/Core/Ap4Utils.cpp:447 AP4_BitReader::ReadCache() const
Shadow bytes around the buggy address:
0x0c087fff9b90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff9ba0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff9bb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff9bc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff9bd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c087fff9be0: fa fa 00 00 00 00 00[fa]fa fa 00 00 00 00 06 fa
0x0c087fff9bf0: fa fa 00 00 00 00 06 fa fa fa 00 00 00 00 00 00
0x0c087fff9c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff9c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff9c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c087fff9c30: 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==3902==ABORTING
### Crash input
https://github.com/17ssDP/fuzzer_crashes/blob/main/Bento4/mp42ts-hbo-01
### Validation 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
./mp42ts mp42ts-hbo-01 /dev/null
### Environment
Ubuntu 16.04
Clang 10.0.1
gcc 5.5
| Heap-buffer-overflow with ASAN in mp42ts | https://api.github.com/repos/axiomatic-systems/Bento4/issues/787/comments | 0 | 2022-10-04T06:36:03Z | 2023-05-29T02:51:18Z | https://github.com/axiomatic-systems/Bento4/issues/787 | 1,395,738,652 | 787 |
[
"axiomatic-systems",
"Bento4"
] | Hi @barbibulle again so soon!
I found a regression introduced by this recent commit (at least I think so)
This audio won't play correctly ([audio.zip](https://github.com/axiomatic-systems/Bento4/files/9692318/audio.zip)), it fails on the second iteration of the loop containing/at this line here: https://github.com/axiomatic-systems/Bento4/blob/6ab668d60a897291644b7e184b1b8a47204cec9e/Source/C%2B%2B/Core/Ap4LinearReader.cpp#L350
Anyway with a little trial and error I think the problem is the new early exit here:
https://github.com/axiomatic-systems/Bento4/blob/6ab668d60a897291644b7e184b1b8a47204cec9e/Source/C%2B%2B/Core/Ap4TrunAtom.cpp#L145-L152
If I rearrange to move the `SetItemCount` before the return to look like this:
```
m_Entries.SetItemCount(sample_count);
int record_fields_count = (int)ComputeRecordFieldsCount(flags);
if (record_fields_count == 0) {
return;
}
if (bytes_left / (record_fields_count*4) < sample_count) {
return;
}
```
Then all is good and playback is restored.
Not sure if this line should move all the way up before any of the introduced return statements?
Thoughts? | 'Stricter Parsing' commit causing issue in playback | https://api.github.com/repos/axiomatic-systems/Bento4/issues/786/comments | 2 | 2022-10-02T11:19:23Z | 2022-10-03T07:12:30Z | https://github.com/axiomatic-systems/Bento4/issues/786 | 1,393,729,845 | 786 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hi, developers of Bento4:
I tested the binary mp4edit with my fuzzer, and a crash incurred—SEGV on unknown address. The following is the details.
# Bug
Detected SEGV on unknown address in mp4edit.
```
root@2e47aa8b3277:/fuzz-mp4edit# ./../Bento4/cmakebuild/mp4edit out/crashes/id\:000002\,sig\:06\,src\:001821\,op\:havoc\,rep\:128\,211239629 /dev/null
WARNING: atom serialized to fewer bytes than declared size
WARNING: atom serialized to fewer bytes than declared size
WARNING: atom serialized to fewer bytes than declared size
WARNING: atom serialized to fewer bytes than declared size
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2207040==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000054f7eb bp 0x7ffea710d720 sp 0x7ffea710d280 T0)
==2207040==The signal is caused by a READ memory access.
==2207040==Hint: address points to the zero page.
#0 0x54f7eb in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&) (/Bento4/cmakebuild/mp4edit+0x54f7eb)
#1 0x553ee9 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4edit+0x553ee9)
#2 0x4fbcdb in main (/Bento4/cmakebuild/mp4edit+0x4fbcdb)
#3 0x7f89e33bac86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#4 0x41d9e9 in _start (/Bento4/cmakebuild/mp4edit+0x41d9e9)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/Bento4/cmakebuild/mp4edit+0x54f7eb) in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&)
==2207040==ABORTING
```
# POC
[POC_mp4edit_211239629.zip](https://github.com/axiomatic-systems/Bento4/files/9691911/POC_mp4edit_211239629.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/))
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Thank you for your time! | SEGV on unknown address 0x000000000000 in mp4edit | https://api.github.com/repos/axiomatic-systems/Bento4/issues/785/comments | 0 | 2022-10-02T06:45:03Z | 2023-05-29T02:51:18Z | https://github.com/axiomatic-systems/Bento4/issues/785 | 1,393,662,899 | 785 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hi, developers of Bento4:
I tested the binary mp4encrypt with my fuzzer, and a crash incurred—SEGV on unknown address. The following is the details.
# Bug
Detected SEGV on unknown address in mp4encrypt.
```
root@2e47aa8b3277:/fuzz-mp4encrypt-ACBC/mp4encrypt# ./mp4encrypt --method MARLIN-IPMP-ACBC ../out/crashes/id:000000,sig:06,src:000718+000108,op:splice,rep:128,203819180 /dev/null
WARNING: track ID 1 will not be encrypted
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2391078==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000028 (pc 0x000000633817 bp 0x7fff9076b400 sp 0x7fff90769aa0 T0)
==2391078==The signal is caused by a READ memory access.
==2391078==Hint: address points to the zero page.
#0 0x633817 in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&) (/fuzz-mp4encrypt-ACBC/mp4encrypt/mp4encrypt+0x633817)
#1 0x658320 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4encrypt-ACBC/mp4encrypt/mp4encrypt+0x658320)
#2 0x42128c in main (/fuzz-mp4encrypt-ACBC/mp4encrypt/mp4encrypt+0x42128c)
#3 0x7fd8c26f7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#4 0x407c99 in _start (/fuzz-mp4encrypt-ACBC/mp4encrypt/mp4encrypt+0x407c99)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/fuzz-mp4encrypt-ACBC/mp4encrypt/mp4encrypt+0x633817) in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&)
==2391078==ABORTING
```
# POC
[POC_mp4encrypt_203819180.zip](https://github.com/axiomatic-systems/Bento4/files/9691800/POC_mp4encrypt_203819180.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/))
Jiayuan Zhang ([NCNIPC of China](http://www.nipc.org.cn/))
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Thank you for your time! | SEGV on unknown address 0x000000000028 in mp4encrypt | https://api.github.com/repos/axiomatic-systems/Bento4/issues/784/comments | 0 | 2022-10-02T04:35:03Z | 2023-05-29T02:51:17Z | https://github.com/axiomatic-systems/Bento4/issues/784 | 1,393,638,825 | 784 |
[
"axiomatic-systems",
"Bento4"
] | To add some context to the question:
Using master branch...
My code is more or less the same as in mp4encrypt app main function. I have linked the library into my multi-threaded application that can execute many threads simultaneously. If I execute only 1 thread, everything seems to works just fine. If I execute many threads I get the assertion below... (always reproducible after running for a short while)
Bento4/Source/C++/Core/Ap4Atom.cpp:763: virtual AP4_Result AP4_AtomListWriter::Action(AP4_Atom*) const: Assertion `bytes_written <= atom->GetSize()' failed. | Is Bento lib reentrant/threadsafe? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/783/comments | 2 | 2022-10-01T15:08:36Z | 2022-10-14T10:59:03Z | https://github.com/axiomatic-systems/Bento4/issues/783 | 1,393,438,840 | 783 |
[
"axiomatic-systems",
"Bento4"
] | # **Summary**
Hi, developers of Bento4:
I tested the binary **mp4pssh** with my fuzzer, and two crash incurred—SEGV on unknown address, and they appear in different locations. The following is the details.
# **Bug1**
SEGV on unknown address in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&).
```
root@e79sdsjkb20sa:/fuzz-mp4pssh/mp4pssh# ./mp4pssh ../out/crashes/poc_mp4pssh_269182975 /dev/null
WARNING: atom serialized to fewer bytes than declared size
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3094421==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000553d62 bp 0x7fff73512f20 sp 0x7fff735115c0 T0)
==3094421==The signal is caused by a READ memory access.
==3094421==Hint: address points to the zero page.
#0 0x553d62 in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&) (/fuzz-mp4pssh/mp4pssh/mp4pssh+0x553d62)
#1 0x56c78d in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4pssh/mp4pssh/mp4pssh+0x56c78d)
#2 0x40fe8e in main (/fuzz-mp4pssh/mp4pssh/mp4pssh+0x40fe8e)
#3 0x7f54bb438c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#4 0x407b19 in _start (/fuzz-mp4pssh/mp4pssh/mp4pssh+0x407b19)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/fuzz-mp4pssh/mp4pssh/mp4pssh+0x553d62) in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&)
==3094421==ABORTING
```
# **Bug2**
Detected SEGV on unknown address in AP4_AtomParent::RemoveChild(AP4_Atom*).
```
root@e79sdsjkb20sa:/fuzz-mp4pssh/mp4pssh# ./mp4pssh POC_mp4pssh_442355513 /dev/null
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3191670==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000432e75 bp 0x7ffd47cbd310 sp 0x7ffd47cbb6b0 T0)
==3191670==The signal is caused by a READ memory access.
==3191670==Hint: address points to the zero page.
#0 0x432e75 in AP4_AtomParent::RemoveChild(AP4_Atom*) (/fuzz-mp4pssh/mp4pssh/mp4pssh+0x432e75)
#1 0x55dea7 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4pssh/mp4pssh/mp4pssh+0x55dea7)
#2 0x40fe8e in main (/fuzz-mp4pssh/mp4pssh/mp4pssh+0x40fe8e)
#3 0x7effed350c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#4 0x407b19 in _start (/fuzz-mp4pssh/mp4pssh/mp4pssh+0x407b19)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/fuzz-mp4pssh/mp4pssh/mp4pssh+0x432e75) in AP4_AtomParent::RemoveChild(AP4_Atom*)
==3191670==ABORTING
```
# **POC**
[POC_mp4pssh_269182975.zip](https://github.com/axiomatic-systems/Bento4/files/9675208/POC_mp4pssh_269182975.zip)
[POC_mp4pssh_442355513.zip](https://github.com/axiomatic-systems/Bento4/files/9713222/POC_mp4pssh_442355513.zip)
# **Environment**
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# **Credit**
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/))
Jiayuan Zhang ([NCNIPC of China](http://www.nipc.org.cn/))
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Thank you for your time! | SEGV on unknown address 0x000000000000 in mp4pssh | https://api.github.com/repos/axiomatic-systems/Bento4/issues/782/comments | 0 | 2022-09-29T13:47:16Z | 2023-05-29T02:51:17Z | https://github.com/axiomatic-systems/Bento4/issues/782 | 1,390,906,871 | 782 |
[
"axiomatic-systems",
"Bento4"
] | Hi again
The attached zip contains the init and a segment from an audio track of a CBCS encrypted stream:
[audio.zip](https://github.com/axiomatic-systems/Bento4/files/9674419/audio.zip)
This decrypts successfully in browser/official app, but bento4/Kodi/inputstream.adaptive is not currently handling this properly.
When trying to create a sampleinfotable it's missing data because there's no SAIZ/SAIO boxes, and the SENC box is effectively empty:

This here actually creates the sampleinfotable: https://github.com/axiomatic-systems/Bento4/blob/5b7cc2500d514717a64675fcf631939494c074ce/Source/C%2B%2B/Core/Ap4CommonEncryption.cpp#L2828-L2838
But m_sampleCount is 0 (and probably more data missing too), no IVs are stored and ultimately calling DecryptSampleData fails here: https://github.com/axiomatic-systems/Bento4/blob/5b7cc2500d514717a64675fcf631939494c074ce/Source/C%2B%2B/Core/Ap4CommonEncryption.cpp#L2127
I'm hoping you can help with a solution or at least point me in the right direction. I've been at it for a couple of hours and tried a few things but now getting to the point of needing some help.
Thanks heaps.
edit: btw this is from the same stream/program with incorrect boxes in the video stream from issue #742 | Failing to correctly do AP4_CencSampleInfoTable::Create on particular file | https://api.github.com/repos/axiomatic-systems/Bento4/issues/781/comments | 3 | 2022-09-29T12:15:13Z | 2022-10-02T06:51:25Z | https://github.com/axiomatic-systems/Bento4/issues/781 | 1,390,770,274 | 781 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hi, developers of Bento4:
I tested the binary Avcinfo with my fuzzer, and a crash incurred—heap-buffer-overflow. The following is the details. I think this error is different from both #731 and #610.
# Bug
Detected heap-buffer-overflow in Avcinfo.
```
root@4w41awdas71:/# ./Bento4/cmakebuild/avcinfo fuzz-avcinfo/out/crashes/POC_avcinfo_15644345
=================================================================
==708228==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000011 at pc 0x0000004fb133 bp 0x7ffea9099cb0 sp 0x7ffea9099ca8
READ of size 1 at 0x602000000011 thread T0
#0 0x4fb132 in main (/Bento4/cmakebuild/avcinfo+0x4fb132)
#1 0x7fa90b673c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#2 0x41d5a9 in _start (/Bento4/cmakebuild/avcinfo+0x41d5a9)
0x602000000011 is located 0 bytes to the right of 1-byte region [0x602000000010,0x602000000011)
allocated by thread T0 here:
#0 0x4f58a8 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x4fb503 in AP4_DataBuffer::SetDataSize(unsigned int) (/Bento4/cmakebuild/avcinfo+0x4fb503)
SUMMARY: AddressSanitizer: heap-buffer-overflow (/Bento4/cmakebuild/avcinfo+0x4fb132) in main
Shadow bytes around the buggy address:
0x0c047fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c047fff8000: fa fa[01]fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8040: fa fa fa fa fa fa fa 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
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
==708228==ABORTING
```
# POC
[POC_avcinfo_15644345.zip](https://github.com/axiomatic-systems/Bento4/files/9658653/POC_avcinfo_15644345.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/))
Jiayuan Zhang ([NCNIPC of China](http://www.nipc.org.cn/))
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Thank you for your time! | A heap-buffer-overflow in Avcinfo | https://api.github.com/repos/axiomatic-systems/Bento4/issues/780/comments | 3 | 2022-09-27T18:09:33Z | 2023-05-29T02:51:16Z | https://github.com/axiomatic-systems/Bento4/issues/780 | 1,388,166,902 | 780 |
[
"axiomatic-systems",
"Bento4"
] | Hello, I use my fuzzer to fuzz binary mp4tag and binary mp42hevc , and found some crashes. The bug1 is different from issue #295, because i run the test-001.mp4 finding it useless. Here are the details.
# Bug1
```
┌──(kali㉿kali)-[~/Desktop/Bento4/cmakebuild]
└─$ ./mp4tag mp4tag_poc
ERROR: cannot open input file
=================================================================
==2376684==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x4c93dd in operator new(unsigned long) (/home/kali/Desktop/Bento4/cmakebuild/mp4tag+0x4c93dd)
#1 0x4ccf5e in ParseCommandLine(int, char**) /home/kali/Desktop/Bento4/Source/C++/Apps/Mp4Tag/Mp4Tag.cpp:207:34
#2 0x4ccf5e in main /home/kali/Desktop/Bento4/Source/C++/Apps/Mp4Tag/Mp4Tag.cpp:783:5
#3 0x7f1b3ea14209 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
SUMMARY: AddressSanitizer: 40 byte(s) leaked in 1 allocation(s).
```
# Bug2
```
┌──(kali㉿kali)-[~/Desktop/Bento4/cmakebuild]
└─$ ./mp42hevc mp42hevc_poc /dev/null 1 ⨯
ERROR: cannot open input (-5)
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2392528==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000004d52c3 bp 0x7fff8ac3ad90 sp 0x7fff8ac3ac40 T0)
==2392528==The signal is caused by a READ memory access.
==2392528==Hint: address points to the zero page.
#0 0x4d52c3 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/kali/Desktop/Bento4/Source/C++/Core/Ap4File.cpp:103:12
#1 0x4d5aea in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/kali/Desktop/Bento4/Source/C++/Core/Ap4File.cpp:78:5
#2 0x4cbea4 in main /home/kali/Desktop/Bento4/Source/C++/Apps/Mp42Hevc/Mp42Hevc.cpp:374:32
#3 0x7fd8587a8209 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#4 0x7fd8587a82bb in __libc_start_main csu/../csu/libc-start.c:389:3
#5 0x41f600 in _start (/home/kali/Desktop/Bento4/cmakebuild/mp42hevc+0x41f600)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/kali/Desktop/Bento4/Source/C++/Core/Ap4File.cpp:103:12 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool)
==2392528==ABORTING
```
# Environment
```
clang 11.0.1
clang++ 11.0.1
version:master branch(commit[5b7cc25](https://github.com/axiomatic-systems/Bento4/commit/5b7cc2500d514717a64675fcf631939494c074ce))+Bento4-1.6.0-639
```
# Platform
```
└─$ uname -a 1 ⨯
Linux kali 5.10.0-kali9-amd64 #1 SMP Debian 5.10.46-4kali1 (2021-08-09) x86_64 GNU/Linux
```
# How to reproduce
```
export CC=clang
export CXX=clang++
export CFLAGS="-fsanitize=address -g"
export CXXFLAGS="-fsanitize=address -g"
mkdir cmakebuild
cd cmakebuild
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
# Note
```
I find the two bugs not only exist in latest branch but also exist in latest release version Bento4-1.6.0-639.
```
# POC
[poc_Bento4.zip](https://github.com/axiomatic-systems/Bento4/files/9653209/poc_Bento4.zip)
# Credit
Yuhang Huang ([NCNIPC of China](http://www.nipc.org.cn/)),(Zhongguancun Laboratory)
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/)),(Zhongguancun Laboratory)
Wanying Cao, Mengyue Feng([NCNIPC of China](http://www.nipc.org.cn/)),(Zhongguancun Laboratory)
Thansk for your time! | There are some vulnerabilities in Bento4 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/779/comments | 0 | 2022-09-27T08:01:55Z | 2023-06-26T06:51:17Z | https://github.com/axiomatic-systems/Bento4/issues/779 | 1,387,303,483 | 779 |
[
"axiomatic-systems",
"Bento4"
] | I am using mp4dash and mp4hls to pack fragmented content (fragmented with mp4fragment). Is there any way to SCTE markers to the segments? I am planing to dynamically replace ads in that splice points using a live transcoder. Can you add more information on this? Whether this is possible using Bento4 or else suggest me something similar.
Appreciate your quick response!
Thank you in advance. | Is there a way to add SCTE 35 splice points to mpeg segments? | https://api.github.com/repos/axiomatic-systems/Bento4/issues/778/comments | 0 | 2022-09-26T06:59:11Z | 2022-09-26T07:04:56Z | https://github.com/axiomatic-systems/Bento4/issues/778 | 1,385,533,774 | 778 |
[
"axiomatic-systems",
"Bento4"
] | 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 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/777/comments | 1 | 2022-09-26T03:28:17Z | 2023-05-29T02:51:15Z | https://github.com/axiomatic-systems/Bento4/issues/777 | 1,385,355,774 | 777 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hi, developers of Bento4:
I tested the binary mp4edit and mp42hevc with my fuzzer, and three crashes incurred, including two memory-leaks from mp4edit and a heap-overflow from mp42hevc. And I think Bug1 and Bug2 are different. The following is the details.
# Bug1
Detected memory leaks in mp4edit.
```
root@25467sd2gsg311:/fuzz-mp4edit/mp4edit# ./mp4edit poc_mp4edit_111062493 /dev/null
WARNING: atom serialized to fewer bytes than declared size
WARNING: atom serialized to fewer bytes than declared size
=================================================================
==1561403==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x8eaf60 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fb56f9ad297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x45f83f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45f83f)
#3 0x55da45 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x55da45)
#4 0x413a42 in main (/fuzz-mp4edit/mp4edit/mp4edit+0x413a42)
#5 0x7fb56f332c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: 88 byte(s) leaked in 1 allocation(s).
```
# Bug2
Another memory-leak-bug in mp4edit.
```
root@25467sd2gsg311:/fuzz-mp4edit/mp4edit# ./mp4edit ../out/crashes/poc_mp4edit_285234531 /dev/null
=================================================================
==2508445==ERROR: LeakSanitizer: detected memory leaks
Indirect leak of 3380 byte(s) in 6 object(s) allocated from:
#0 0x8eaf60 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fe0fef0e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x46ae44 in AP4_AvccAtom::Create(unsigned int, AP4_ByteStream&) (/fuzz-mp4edit/mp4edit/mp4edit+0x46ae44)
#3 0x45540f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45540f)
#4 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#5 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#6 0x5d7069 in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x5d7069)
#7 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#8 0x62020e in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x62020e)
#9 0x61f694 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x61f694)
#10 0x4546d3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4546d3)
#11 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#12 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#13 0x48d616 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x48d616)
#14 0x45cb77 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45cb77)
#15 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#16 0x45f83f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45f83f)
#17 0x55da45 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x55da45)
#18 0x413a42 in main (/fuzz-mp4edit/mp4edit/mp4edit+0x413a42)
#19 0x7fe0fe893c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
…… ……
Indirect leak of 1 byte(s) in 1 object(s) allocated from:
#0 0x8eaf60 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fe0fef0e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x5d6bbf in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x5d6bbf)
#3 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#4 0x62020e in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x62020e)
#5 0x61f694 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x61f694)
#6 0x4546d3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4546d3)
#7 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#8 0x48de17 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4edit/mp4edit/mp4edit+0x48de17)
#9 0x48d616 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x48d616)
#10 0x45cb77 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45cb77)
#11 0x4618ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x4618ff)
#12 0x45f83f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4edit/mp4edit/mp4edit+0x45f83f)
#13 0x55da45 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4edit/mp4edit/mp4edit+0x55da45)
#14 0x413a42 in main (/fuzz-mp4edit/mp4edit/mp4edit+0x413a42)
#15 0x7fe0fe893c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: 6486 byte(s) leaked in 58 allocation(s).
```
# Bug3
Heap-buffer-overflow on address 0x6020000002d4 in mp42hevc.
```
root@2e47aa8b3277:/# ./Bento4/cmakebuild/mp42hevc POC_mp42hevc_8055240 /dev/null
Video Track:
duration: 200 ms
sample count: 6
=================================================================
==2354250==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000002d4 at pc 0x0000004fb753 bp 0x7fffdc3cf910 sp 0x7fffdc3cf908
READ of size 1 at 0x6020000002d4 thread T0
#0 0x4fb752 in WriteSample(AP4_DataBuffer const&, AP4_DataBuffer&, unsigned int, AP4_ByteStream*) (/Bento4/cmakebuild/mp42hevc+0x4fb752)
#1 0x4f9a2d in main (/Bento4/cmakebuild/mp42hevc+0x4f9a2d)
#2 0x7f79552d9c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#3 0x41d999 in _start (/Bento4/cmakebuild/mp42hevc+0x41d999)
0x6020000002d4 is located 0 bytes to the right of 4-byte region [0x6020000002d0,0x6020000002d4)
allocated by thread T0 here:
#0 0x4f5c98 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x501bd8 in AP4_DataBuffer::SetDataSize(unsigned int) (/Bento4/cmakebuild/mp42hevc+0x501bd8)
SUMMARY: AddressSanitizer: heap-buffer-overflow (/Bento4/cmakebuild/mp42hevc+0x4fb752) in WriteSample(AP4_DataBuffer const&, AP4_DataBuffer&, unsigned int, AP4_ByteStream*)
Shadow bytes around the buggy address:
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 01 fa
0x0c047fff8020: fa fa fd fa fa fa fd fa fa fa 06 fa fa fa 00 fa
0x0c047fff8030: fa fa fd fa fa fa 04 fa fa fa fd fd fa fa fd fa
0x0c047fff8040: fa fa 01 fa fa fa fd fd fa fa fd fa fa fa fd fa
=>0x0c047fff8050: fa fa 06 fa fa fa 01 fa fa fa[04]fa fa fa fd fa
0x0c047fff8060: fa fa fd 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
0x0c047fff80a0: 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
==2354250==ABORTING
```
# POC
[Bug_1_POC.zip](https://github.com/axiomatic-systems/Bento4/files/9640968/Bug_1_POC.zip)
[Bug_2_POC.zip](https://github.com/axiomatic-systems/Bento4/files/9675042/Bug_2_POC.zip)
[Bug_3_POC.zip](https://github.com/axiomatic-systems/Bento4/files/9675049/Bug_3_POC.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch([5b7cc25](https://github.com/axiomatic-systems/Bento4/commit/5b7cc2500d514717a64675fcf631939494c074ce)) && Bento4 latest release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/))
Yuhang Huang ([NCNIPC of China](http://www.nipc.org.cn/))
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Thank you for your time! | Memory-leak and heap-overflow bugs in Bento4 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/776/comments | 0 | 2022-09-25T14:31:41Z | 2023-05-29T02:51:14Z | https://github.com/axiomatic-systems/Bento4/issues/776 | 1,385,048,849 | 776 |
[
"axiomatic-systems",
"Bento4"
] | Hello, I use fuzer to test binary acc2mp4, and found some carshes, which can result binary mp4split crash too. Here are the details.
# Bug1
```
root@d5f4647d38bd:/aac2mp4/aac2mp4# /Bento4/build/aac2mp4 crash1 /dev/null
AAC frame [000000]: size = -7, 96000 kHz, 0 ch
=================================================================
==813117==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62d000008400 at pc 0x0000004ad912 bp 0x7ffe2c57b390 sp 0x7ffe2c57ab40
READ of size 4294967287 at 0x62d000008400 thread T0
#0 0x4ad911 in __asan_memcpy /llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22
#1 0x4facae in AP4_BitStream::ReadBytes(unsigned char*, unsigned int) /Bento4/Source/C++/Codecs/Ap4BitStream.cpp:192:10
#2 0x4f8485 in main /Bento4/Source/C++/Apps/Aac2Mp4/Aac2Mp4.cpp:142:29
#3 0x7fec98881c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#4 0x41c349 in _start (/Bento4/build/aac2mp4+0x41c349)
0x62d000008400 is located 0 bytes to the right of 32768-byte region [0x62d000000400,0x62d000008400)
allocated by thread T0 here:
#0 0x4f4638 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x4fa30d in AP4_BitStream::AP4_BitStream() /Bento4/Source/C++/Codecs/Ap4BitStream.cpp:45:16
#2 0x7fec98881c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: heap-buffer-overflow /llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22 in __asan_memcpy
Shadow bytes around the buggy address:
0x0c5a7fff9030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c5a7fff9040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c5a7fff9050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c5a7fff9060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c5a7fff9070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c5a7fff9080:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c5a7fff9090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c5a7fff90a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c5a7fff90b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c5a7fff90c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c5a7fff90d0: 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
==813117==ABORTING
```
# Bug2
```
root@d5f4647d38bd:/aac2mp4/aac2mp4# ./mp4split crash2
no movie found in file
=================================================================
==888268==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 48 byte(s) in 1 object(s) allocated from:
#0 0x4f45d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5de94f in AP4_StdcFileByteStream::Create(AP4_FileByteStream*, char const*, AP4_FileByteStream::Mode, AP4_ByteStream*&) /Bento4/Source/C++/System/StdC/Ap4StdCFileByteStream.cpp:279:14
Indirect leak of 256 byte(s) in 1 object(s) allocated from:
#0 0x4f45d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x536495 in AP4_Array<unsigned int>::EnsureCapacity(unsigned int) /Bento4/Source/C++/Core/Ap4Array.h:172:25
#2 0x536495 in AP4_Array<unsigned int>::Append(unsigned int const&) /Bento4/Source/C++/Core/Ap4Array.h:252:29
#3 0x536495 in AP4_FtypAtom::AP4_FtypAtom(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4FtypAtom.cpp:57:28
#4 0x50966b in AP4_FtypAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4FtypAtom.h:66:20
#5 0x50966b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:630:20
#6 0x507ec4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#7 0x5076ee in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#8 0x5350be in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /Bento4/Source/C++/Core/Ap4File.cpp:104:12
#9 0x5357ed in AP4_File::AP4_File(AP4_ByteStream&, bool) /Bento4/Source/C++/Core/Ap4File.cpp:78:5
#10 0x4f841f in main /Bento4/Source/C++/Apps/Mp4Split/Mp4Split.cpp:258:26
#11 0x7f11ba50dc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x4f45d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x507f57 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:242:16
#2 0x5076ee in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#3 0x5350be in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /Bento4/Source/C++/Core/Ap4File.cpp:104:12
#4 0x5357ed in AP4_File::AP4_File(AP4_ByteStream&, bool) /Bento4/Source/C++/Core/Ap4File.cpp:78:5
#5 0x4f841f in main /Bento4/Source/C++/Apps/Mp4Split/Mp4Split.cpp:258:26
#6 0x7f11ba50dc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 72 byte(s) in 1 object(s) allocated from:
#0 0x4f45d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x4f83f7 in main /Bento4/Source/C++/Apps/Mp4Split/Mp4Split.cpp:258:22
#2 0x7f11ba50dc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 72 byte(s) in 1 object(s) allocated from:
#0 0x4f45d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x509659 in AP4_FtypAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4FtypAtom.h:66:16
#2 0x509659 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:630:20
#3 0x507ec4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#4 0x5076ee in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#5 0x5350be in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /Bento4/Source/C++/Core/Ap4File.cpp:104:12
#6 0x5357ed in AP4_File::AP4_File(AP4_ByteStream&, bool) /Bento4/Source/C++/Core/Ap4File.cpp:78:5
#7 0x4f841f in main /Bento4/Source/C++/Apps/Mp4Split/Mp4Split.cpp:258:26
#8 0x7f11ba50dc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 48 byte(s) in 2 object(s) allocated from:
#0 0x4f45d8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x4fd2d3 in AP4_List<AP4_Atom>::Add(AP4_Atom*) /Bento4/Source/C++/Core/Ap4List.h:160:16
#2 0x4fd2d3 in AP4_AtomParent::AddChild(AP4_Atom*, int) /Bento4/Source/C++/Core/Ap4Atom.cpp:532:29
SUMMARY: AddressSanitizer: 584 byte(s) leaked in 7 allocation(s).
```
# Environment
Ubuntu 18.04(docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch([5b7cc25](https://github.com/axiomatic-systems/Bento4/commit/5b7cc2500d514717a64675fcf631939494c074ce))
# How to reproduce
```
export CC=clang
export CXX=clang++
export CFLAGS="-fsanitize=address -g"
export CXXFLAGS="-fsanitize=address -g"
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
# POC
[crash.zip](https://github.com/axiomatic-systems/Bento4/files/9638201/crash.zip)
# Credit
Yuhang Huang ([NCNIPC of China](http://www.nipc.org.cn/)),(Zhongguancun Laboratory)
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/)),(Zhongguancun Laboratory)
Yin li,Jiayu Zhao([NCNIPC of China](http://www.nipc.org.cn/)),(Zhongguancun Laboratory)
# Notice
I find the two bugs not only exist in latest branch but also exist in latest release version Bento4-1.6.0-639.
The bug1 is similar to the issuse#363([CVE-2019-8378](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8378)),which means this bug hasn't been fixed now.
Thanks for your time! | there are some bugs in Bento4 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/775/comments | 0 | 2022-09-24T07:42:46Z | 2023-06-26T06:38:57Z | https://github.com/axiomatic-systems/Bento4/issues/775 | 1,384,568,694 | 775 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hi there,
These are some faults that can lead to memory leaks in mp4xx, the version of Bento4 is the latest (the newest master branch) and the operation system is Ubuntu 18.04.6 LTS (docker), these crashes with the following.
# Bug1
Detected memory leaks in mp4edit:
```
root@fhdsa2324q1:/# ./Bento4/cmakebuild/mp4edit --remove 1 mp4box/mp4/POC_mp4edit_ml_1 /dev/dull
ERROR: atom '1' not found
=================================================================
==19185==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 160 byte(s) in 10 object(s) allocated from:
#0 0x4f5b88 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x551285 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4edit+0x551285)
#2 0x4fbcdb in main (/Bento4/cmakebuild/mp4edit+0x4fbcdb)
#3 0x7fd45e496c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 1392 byte(s) in 9 object(s) allocated from:
#0 0x4f5b88 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x59421f in AP4_TrunAtom::AP4_TrunAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) (/Bento4/cmakebuild/mp4edit+0x59421f)
#2 0x593d48 in AP4_TrunAtom::Create(unsigned int, AP4_ByteStream&) (/Bento4/cmakebuild/mp4edit+0x593d48)
#3 0x5096ab in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x5096ab)
#4 0x50e1d1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50e1d1)
#5 0x51a03a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/Bento4/cmakebuild/mp4edit+0x51a03a)
#6 0x519702 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4edit+0x519702)
#7 0x50a13f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50a13f)
#8 0x50e1d1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50e1d1)
#9 0x51a03a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/Bento4/cmakebuild/mp4edit+0x51a03a)
#10 0x519702 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4edit+0x519702)
#11 0x50a13f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50a13f)
#12 0x50e1d1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50e1d1)
#13 0x50da0a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50da0a)
#14 0x5510d2 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4edit+0x5510d2)
#15 0x4fbcdb in main (/Bento4/cmakebuild/mp4edit+0x4fbcdb)
#16 0x7fd45e496c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 800 byte(s) in 10 object(s) allocated from:
#0 0x4f5b88 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5195e8 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4edit+0x5195e8)
#2 0x50a13f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50a13f)
#3 0x50e1d1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50e1d1)
#4 0x50da0a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50da0a)
#5 0x5510d2 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4edit+0x5510d2)
#6 0x4fbcdb in main (/Bento4/cmakebuild/mp4edit+0x4fbcdb)
#7 0x7fd45e496c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
…… ……
Indirect leak of 480 byte(s) in 20 object(s) allocated from:
#0 0x4f5b88 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x51a0b4 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/Bento4/cmakebuild/mp4edit+0x51a0b4)
#2 0x519702 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4edit+0x519702)
#3 0x50a13f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50a13f)
#4 0x50e1d1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50e1d1)
#5 0x50da0a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/Bento4/cmakebuild/mp4edit+0x50da0a)
#6 0x5510d2 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4edit+0x5510d2)
#7 0x4fbcdb in main (/Bento4/cmakebuild/mp4edit+0x4fbcdb)
#8 0x7fd45e496c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: 6752 byte(s) leaked in 129 allocation(s).
```
# Bug2
Detected memory leaks in mp4decrypt:
```
Script started on 2022-09-24 05:36:45+0000
# ./Bento4/cmakebuild/mp4decrypt --fragments-info /dev/null POC_mp4decrypt_ml_1 /dev/null
=================================================================
[31m==19333==ERROR: LeakSanitizer: detected memory leaks
[1m[0m
[1m[34mDirect leak of 88 byte(s) in 1 object(s) allocated from:
[1m[0m #0 0x4f5b88 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5016d1 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x5016d1)
#2 0x500e7a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x500e7a)
#3 0x572832 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4decrypt+0x572832)
#4 0x4fabcc in main (/Bento4/cmakebuild/mp4decrypt+0x4fabcc)
#5 0x7f31c3cf7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
[1m[34mDirect leak of 72 byte(s) in 1 object(s) allocated from:
[1m[0m #0 0x4f5b88 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x4fd2a9 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x4fd2a9)
#2 0x501641 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x501641)
#3 0x500e7a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x500e7a)
#4 0x572832 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4decrypt+0x572832)
#5 0x4fabcc in main (/Bento4/cmakebuild/mp4decrypt+0x4fabcc)
#6 0x7f31c3cf7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
…… ……
[1m[34mIndirect leak of 8 byte(s) in 2 object(s) allocated from:
[1m[0m #0 0x4f5ce8 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x59ebd0 in AP4_String::Assign(char const*, unsigned int) (/Bento4/cmakebuild/mp4decrypt+0x59ebd0)
[1m[34mIndirect leak of 4 byte(s) in 1 object(s) allocated from:
[1m[0m #0 0x4f5b88 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5a4b0a in AP4_StssAtom::AP4_StssAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) (/Bento4/cmakebuild/mp4decrypt+0x5a4b0a)
#2 0x5a47f2 in AP4_StssAtom::Create(unsigned int, AP4_ByteStream&) (/Bento4/cmakebuild/mp4decrypt+0x5a47f2)
#3 0x4fdb71 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x4fdb71)
#4 0x501641 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x501641)
#5 0x53157a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/Bento4/cmakebuild/mp4decrypt+0x53157a)
#6 0x530c42 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4decrypt+0x530c42)
#7 0x4fd320 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x4fd320)
#8 0x501641 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x501641)
#9 0x53157a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/Bento4/cmakebuild/mp4decrypt+0x53157a)
#10 0x530c42 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4decrypt+0x530c42)
#11 0x4fd320 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x4fd320)
#12 0x501641 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x501641)
#13 0x53157a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/Bento4/cmakebuild/mp4decrypt+0x53157a)
#14 0x530c42 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4decrypt+0x530c42)
#15 0x4fd320 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x4fd320)
#16 0x501641 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x501641)
#17 0x53157a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/Bento4/cmakebuild/mp4decrypt+0x53157a)
#18 0x531c31 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4decrypt+0x531c31)
#19 0x501641 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x501641)
#20 0x53157a in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/Bento4/cmakebuild/mp4decrypt+0x53157a)
#21 0x531c31 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4decrypt+0x531c31)
#22 0x4fe3ac in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x4fe3ac)
#23 0x501641 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x501641)
#24 0x500e7a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/Bento4/cmakebuild/mp4decrypt+0x500e7a)
#25 0x572832 in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/Bento4/cmakebuild/mp4decrypt+0x572832)
#26 0x4fabcc in main (/Bento4/cmakebuild/mp4decrypt+0x4fabcc)
#27 0x7f31c3cf7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
[1m[34mIndirect leak of 2 byte(s) in 1 object(s) allocated from:
[1m[0m #0 0x4f5ce8 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x539518 in AP4_DataBuffer::SetDataSize(unsigned int) (/Bento4/cmakebuild/mp4decrypt+0x539518)
SUMMARY: AddressSanitizer: 8035 byte(s) leaked in 140 allocation(s).
# exit
Script done on 2022-09-24 05:37:14+0000
```
# Bug3
Detected memory leaks in mp4dcfpackager:
```
root@23detw3278w:/# ./Bento4/cmakebuild/mp4dcfpackager --method CBC --key 00112233445566778899aabbccddeeff:00112233445566778899aabbccddeeff POC_mp4dcfpackager_ml_1 /dev/null
=================================================================
==19354==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 1112 byte(s) in 1 object(s) allocated from:
#0 0x4f5b38 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x513e34 in AP4_EncryptingStream::Create(AP4_BlockCipher::CipherMode, AP4_ByteStream&, unsigned char const*, unsigned int, unsigned char const*, unsigned int, bool, AP4_BlockCipherFactory*, AP4_ByteStream*&) (/Bento4/cmakebuild/mp4dcfpackager+0x513e34)
#2 0x4f9ee9 in main (/Bento4/cmakebuild/mp4dcfpackager+0x4f9ee9)
#3 0x7fbf18a68c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 264 byte(s) in 1 object(s) allocated from:
#0 0x4f5b38 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x536fd0 in AP4_AesBlockCipher::Create(unsigned char const*, AP4_BlockCipher::CipherDirection, AP4_BlockCipher::CipherMode, void const*, AP4_AesBlockCipher*&) (/Bento4/cmakebuild/mp4dcfpackager+0x536fd0)
#2 0xffeeddccbbaa9987 (<unknown module>)
Indirect leak of 96 byte(s) in 1 object(s) allocated from:
#0 0x4f5b38 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x513d8f in AP4_EncryptingStream::Create(AP4_BlockCipher::CipherMode, AP4_ByteStream&, unsigned char const*, unsigned int, unsigned char const*, unsigned int, bool, AP4_BlockCipherFactory*, AP4_ByteStream*&) (/Bento4/cmakebuild/mp4dcfpackager+0x513d8f)
#2 0x4f9ee9 in main (/Bento4/cmakebuild/mp4dcfpackager+0x4f9ee9)
#3 0x7fbf18a68c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
#0 0x4f5b38 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x54426d in AP4_FileByteStream::Create(char const*, AP4_FileByteStream::Mode, AP4_ByteStream*&) (/Bento4/cmakebuild/mp4dcfpackager+0x54426d)
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x4f5b38 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x538e02 in AP4_AesBlockCipher::Create(unsigned char const*, AP4_BlockCipher::CipherDirection, AP4_BlockCipher::CipherMode, void const*, AP4_AesBlockCipher*&) (/Bento4/cmakebuild/mp4dcfpackager+0x538e02)
SUMMARY: AddressSanitizer: 1544 byte(s) leaked in 5 allocation(s).
```
# Bug4
Detected memory leaks in mp4fragment:
```
root@239qdsyi432g9:/# ./Bento4/cmakebuild/mp4fragment --track audio POC_mp4fragment_ml_1 /dev/null
unable to autodetect fragment duration, using default
=================================================================
==19409==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 104 byte(s) in 1 object(s) allocated from:
#0 0x4f5bc8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x4fa337 in main (/Bento4/cmakebuild/mp4fragment+0x4fa337)
#2 0x7fccddee4c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 72 byte(s) in 1 object(s) allocated from:
#0 0x4f5bc8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x4fa3d7 in main (/Bento4/cmakebuild/mp4fragment+0x4fa3d7)
#2 0x7fccddee4c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x4f5bc8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x4fa089 in main (/Bento4/cmakebuild/mp4fragment+0x4fa089)
#2 0x7fccddee4c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 10 byte(s) in 1 object(s) allocated from:
#0 0x4f5d28 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x4fa1de in main (/Bento4/cmakebuild/mp4fragment+0x4fa1de)
#2 0x7fccddee4c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: 218 byte(s) leaked in 4 allocation(s).
```
# Bug5
Detected memory leaks in mp4tag :
```
root@87asf23gm783:/# ./Bento4/cmakebuild/mp4tag --add 1:S:add POC_mp4tag_ml_1
ERROR: output file name missing
MP4 File Tagger - Version 1.2 (Bento4 Version 1.6.0.0)
(c) 2002-2008 Axiomatic Systems, LLC
=================================================================
==19430==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x4f5c58 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x4f9f5f in main (/Bento4/cmakebuild/mp4tag+0x4f9f5f)
#2 0x7f787d2d5c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x4f5db8 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x57c950 in AP4_String::AP4_String(char const*) (/Bento4/cmakebuild/mp4tag+0x57c950)
#2 0x7f787d2d5c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: 48 byte(s) leaked in 2 allocation(s).
```
# POC
[POC_Bug1-5.zip](https://github.com/axiomatic-systems/Bento4/files/9638123/POC_Bug1-5.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/))
Yuhang Huang ([NCNIPC of China](http://www.nipc.org.cn/))
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Jiayuan Zhang ([NCNIPC of China](http://www.nipc.org.cn/))
Thank you for your time! | Some Memory leaks exist in Bento4 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/774/comments | 0 | 2022-09-24T07:04:26Z | 2023-05-29T02:51:13Z | https://github.com/axiomatic-systems/Bento4/issues/774 | 1,384,557,007 | 774 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hello, I found three heap buffer overflow bugs in AP4_Atom::TypeFromString(char const*), AP4_BitReader::ReadBit() and AP4_BitReader::ReadBits(unsigned int). They come from mp4tag and mp4mux, respectively.
# Bug1
Heap-buffer-overflow on address 0x602000000332 in mp4tag:
```
root@728d9sls452:/fuzz-mp4tag/mp4tag# ./mp4tag --remove 1 ../out/crashes/mp4tag_poc_1 /dev/null
=================================================================
==1647110==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000332 at pc 0x000000468f25 bp 0x7fff3510c600 sp 0x7fff3510c5f8
READ of size 1 at 0x602000000332 thread T0
#0 0x468f24 in AP4_Atom::TypeFromString(char const*) (/fuzz-mp4tag/mp4tag/mp4tag+0x468f24)
#1 0x755566 in AP4_MetaData::Entry::FindInIlst(AP4_ContainerAtom*) const (/fuzz-mp4tag/mp4tag/mp4tag+0x755566)
#2 0x75a3f2 in AP4_MetaData::Entry::RemoveFromFileIlst(AP4_File&, unsigned int) (/fuzz-mp4tag/mp4tag/mp4tag+0x75a3f2)
#3 0x42fc2c in RemoveTag(AP4_File*, AP4_String&, bool) (/fuzz-mp4tag/mp4tag/mp4tag+0x42fc2c)
#4 0x418531 in main (/fuzz-mp4tag/mp4tag/mp4tag+0x418531)
#5 0x7fdb89b2ec86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#6 0x407f09 in _start (/fuzz-mp4tag/mp4tag/mp4tag+0x407f09)
0x602000000332 is located 0 bytes to the right of 2-byte region [0x602000000330,0x602000000332)
allocated by thread T0 here:
#0 0x996920 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fdb8a1a9297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x418531 in main (/fuzz-mp4tag/mp4tag/mp4tag+0x418531)
#3 0x7fdb89b2ec86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: heap-buffer-overflow (/fuzz-mp4tag/mp4tag/mp4tag+0x468f24) in AP4_Atom::TypeFromString(char const*)
Shadow bytes around the buggy address:
0x0c047fff8010: fa fa fd fd fa fa 04 fa fa fa fd fd fa fa 00 05
0x0c047fff8020: fa fa 01 fa fa fa 01 fa fa fa fd fa fa fa 03 fa
0x0c047fff8030: fa fa fd fa fa fa 06 fa fa fa 00 fa fa fa fd fa
0x0c047fff8040: fa fa 04 fa fa fa fd fd fa fa fd fa fa fa 01 fa
0x0c047fff8050: fa fa fd fa fa fa 00 00 fa fa 05 fa fa fa 00 00
=>0x0c047fff8060: fa fa 02 fa fa fa[02]fa fa fa 05 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
0x0c047fff80a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff80b0: 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
==1647110==ABORTING
```
# Bug2
Heap-buffer-overflow on address 0x6020000000f8 in mp4mux (AP4_BitReader::ReadBits):
```
root@23iq42wasf35:/fuzz-mp4mux/mp4mux# \./mp4mux --track h264:../out/crashes/id\:000045\,sig\:06\,src\:000002\,op\:int32\,pos\:33\,val\:\+0\,470985 /dev/null
=================================================================
==2473731==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000000f8 at pc 0x000000649cb8 bp 0x7ffced185f90 sp 0x7ffced185f88
READ of size 1 at 0x6020000000f8 thread T0
#0 0x649cb7 in AP4_BitReader::ReadBits(unsigned int) (/fuzz-mp4mux/mp4mux/mp4mux+0x649cb7)
#1 0x4d6040 in ReadGolomb(AP4_BitReader&) (/fuzz-mp4mux/mp4mux/mp4mux+0x4d6040)
#2 0x4d6ef9 in AP4_AvcFrameParser::ParsePPS(unsigned char const*, unsigned int, AP4_AvcPictureParameterSet&) (/fuzz-mp4mux/mp4mux/mp4mux+0x4d6ef9)
#3 0x4f01dd in AP4_AvcFrameParser::Feed(unsigned char const*, unsigned int, AP4_AvcFrameParser::AccessUnitInfo&, bool) (/fuzz-mp4mux/mp4mux/mp4mux+0x4f01dd)
#4 0x4ecbf1 in AP4_AvcFrameParser::Feed(void const*, unsigned int, unsigned int&, AP4_AvcFrameParser::AccessUnitInfo&, bool) (/fuzz-mp4mux/mp4mux/mp4mux+0x4ecbf1)
#5 0x4349a5 in main (/fuzz-mp4mux/mp4mux/mp4mux+0x4349a5)
#6 0x7fb87db03c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#7 0x407df9 in _start (/fuzz-mp4mux/mp4mux/mp4mux+0x407df9)
0x6020000000f8 is located 0 bytes to the right of 8-byte region [0x6020000000f0,0x6020000000f8)
allocated by thread T0 here:
#0 0xa84ba0 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fb87e17e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4f01dd in AP4_AvcFrameParser::Feed(unsigned char const*, unsigned int, AP4_AvcFrameParser::AccessUnitInfo&, bool) (/fuzz-mp4mux/mp4mux/mp4mux+0x4f01dd)
#3 0x4349a5 in main (/fuzz-mp4mux/mp4mux/mp4mux+0x4349a5)
#4 0x7fb87db03c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: heap-buffer-overflow (/fuzz-mp4mux/mp4mux/mp4mux+0x649cb7) in AP4_BitReader::ReadBits(unsigned int)
Shadow bytes around the buggy address:
0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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 00 03 fa fa 06 fa fa fa 06 fa fa fa 00[fa]
0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8040: fa fa fa fa fa fa fa 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
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
==2473731==ABORTING
```
# Bug3
Heap-buffer-overflow on address 0x602000000158 in mp4mux (AP4_BitReader::ReadBit):
```
root@345sadsf12w332:/fuzz-mp4mux/mp4mux# ./mp4mux --track h264:../out/crashes/id\:000001\,sig\:06\,src\:000002\,op\:flip1\,pos\:8\,10085 /dev/null
=================================================================
==1606856==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000158 at pc 0x00000064a882 bp 0x7ffd08428400 sp 0x7ffd084283f8
READ of size 1 at 0x602000000158 thread T0
#0 0x64a881 in AP4_BitReader::ReadBit() (/fuzz-mp4mux/mp4mux/mp4mux+0x64a881)
#1 0x4d6456 in ReadGolomb(AP4_BitReader&) (/fuzz-mp4mux/mp4mux/mp4mux+0x4d6456)
#2 0x4dcd9e in AP4_AvcFrameParser::ParseSliceHeader(unsigned char const*, unsigned int, unsigned int, unsigned int, AP4_AvcSliceHeader&) (/fuzz-mp4mux/mp4mux/mp4mux+0x4dcd9e)
#3 0x4ed906 in AP4_AvcFrameParser::Feed(unsigned char const*, unsigned int, AP4_AvcFrameParser::AccessUnitInfo&, bool) (/fuzz-mp4mux/mp4mux/mp4mux+0x4ed906)
#4 0x4ecbf1 in AP4_AvcFrameParser::Feed(void const*, unsigned int, unsigned int&, AP4_AvcFrameParser::AccessUnitInfo&, bool) (/fuzz-mp4mux/mp4mux/mp4mux+0x4ecbf1)
#5 0x4349a5 in main (/fuzz-mp4mux/mp4mux/mp4mux+0x4349a5)
#6 0x7fd9e3df9c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#7 0x407df9 in _start (/fuzz-mp4mux/mp4mux/mp4mux+0x407df9)
0x602000000158 is located 0 bytes to the right of 8-byte region [0x602000000150,0x602000000158)
allocated by thread T0 here:
#0 0xa84ba0 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fd9e4474297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4ed906 in AP4_AvcFrameParser::Feed(unsigned char const*, unsigned int, AP4_AvcFrameParser::AccessUnitInfo&, bool) (/fuzz-mp4mux/mp4mux/mp4mux+0x4ed906)
#3 0x4349a5 in main (/fuzz-mp4mux/mp4mux/mp4mux+0x4349a5)
#4 0x7fd9e3df9c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: heap-buffer-overflow (/fuzz-mp4mux/mp4mux/mp4mux+0x64a881) in AP4_BitReader::ReadBit()
Shadow bytes around the buggy address:
0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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 00 03 fa fa 06 fa fa fa fd fa fa fa fd fa
=>0x0c047fff8020: fa fa 06 fa fa fa 07 fa fa fa 00[fa]fa fa fa fa
0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8040: fa fa fa fa fa fa fa 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
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
==1606856==ABORTING
```
# POC
[Bug_1_POC.zip](https://github.com/axiomatic-systems/Bento4/files/9635523/Bug_1_POC.zip)
[Bug-2-POC.zip](https://github.com/axiomatic-systems/Bento4/files/9635529/Bug-2-POC.zip)
[Bug-3-POC.zip](https://github.com/axiomatic-systems/Bento4/files/9635530/Bug-3-POC.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/)), (Zhongguancun Laboratory)
Yuhang Huang ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Jiayuan Zhang ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Hao Zhang ([NCNIPC of China](http://www.nipc.org.cn/)), ([Xidian University](https://www.xidian.edu.cn/))
Thank you for your time! | Some heap-buffer-overflow bugs in Bento4 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/773/comments | 0 | 2022-09-23T16:44:03Z | 2023-06-12T07:07:50Z | https://github.com/axiomatic-systems/Bento4/issues/773 | 1,384,054,185 | 773 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hi there,
These are some faults that maybe lead to serious consequences in mp4xx, the version of Bento4 is the latest (the newest master branch) and the operation system is Ubuntu 18.04.6 LTS (docker), these binary-crashes with the following.
# Bug1
Detected memory leaks in mp4spilt:
```
root@32345fj4sds:/fuzz-mp4split/mp4split# ./mp4split --video ../out/crashes/poc_split_1
--video option specified, but no video track found
=================================================================
==1889275==ERROR: LeakSanitizer: detected memory leaks
Indirect leak of 592 byte(s) in 2 object(s) allocated from:
#0 0x8c7670 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f88d8e08297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x462e2f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x462e2f)
#3 0x48ef27 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4split/mp4split/mp4split+0x48ef27)
#4 0x490c11 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4split/mp4split/mp4split+0x490c11)
Indirect leak of 256 byte(s) in 1 object(s) allocated from:
#0 0x8c7670 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f88d8e08297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x45904a in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x45904a)
#3 0x462a0f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x462a0f)
#4 0x46094f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x46094f)
#5 0x4c4b30 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) (/fuzz-mp4split/mp4split/mp4split+0x4c4b30)
#6 0x4c6558 in AP4_File::AP4_File(AP4_ByteStream&, bool) (/fuzz-mp4split/mp4split/mp4split+0x4c6558)
#7 0x40abba in main (/fuzz-mp4split/mp4split/mp4split+0x40abba)
#8 0x7f88d878dc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 224 byte(s) in 7 object(s) allocated from:
#0 0x8c7670 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f88d8e08297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c6558 in AP4_File::AP4_File(AP4_ByteStream&, bool) (/fuzz-mp4split/mp4split/mp4split+0x4c6558)
#3 0x40abba in main (/fuzz-mp4split/mp4split/mp4split+0x40abba)
#4 0x7f88d878dc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 192 byte(s) in 2 object(s) allocated from:
#0 0x8c7670 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f88d8e08297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x462a0f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x462a0f)
#3 0x46094f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x46094f)
#4 0x4c4b30 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) (/fuzz-mp4split/mp4split/mp4split+0x4c4b30)
#5 0x4c6558 in AP4_File::AP4_File(AP4_ByteStream&, bool) (/fuzz-mp4split/mp4split/mp4split+0x4c6558)
#6 0x40abba in main (/fuzz-mp4split/mp4split/mp4split+0x40abba)
#7 0x7f88d878dc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 176 byte(s) in 2 object(s) allocated from:
#0 0x8c7670 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f88d8e08297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x46094f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x46094f)
#3 0x4c4b30 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) (/fuzz-mp4split/mp4split/mp4split+0x4c4b30)
#4 0x4c6558 in AP4_File::AP4_File(AP4_ByteStream&, bool) (/fuzz-mp4split/mp4split/mp4split+0x4c6558)
#5 0x40abba in main (/fuzz-mp4split/mp4split/mp4split+0x40abba)
#6 0x7f88d878dc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
…… ……
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x8c7670 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f88d8e08297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4bdd4d in AP4_ElstAtom::Create(unsigned int, AP4_ByteStream&) (/fuzz-mp4split/mp4split/mp4split+0x4bdd4d)
#3 0x45831c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x45831c)
#4 0x462a0f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x462a0f)
#5 0x48ef27 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4split/mp4split/mp4split+0x48ef27)
#6 0x48e726 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4split/mp4split/mp4split+0x48e726)
#7 0x45dc8c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x45dc8c)
#8 0x462a0f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x462a0f)
#9 0x48ef27 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4split/mp4split/mp4split+0x48ef27)
#10 0x490c11 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4split/mp4split/mp4split+0x490c11)
Indirect leak of 1 byte(s) in 1 object(s) allocated from:
#0 0x8c7670 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f88d8e08297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x771319 in AP4_DescriptorFactory::CreateDescriptorFromStream(AP4_ByteStream&, AP4_Descriptor*&) (/fuzz-mp4split/mp4split/mp4split+0x771319)
#3 0x539cf7 in AP4_InitialObjectDescriptor::AP4_InitialObjectDescriptor(AP4_ByteStream&, unsigned char, unsigned int, unsigned int) (/fuzz-mp4split/mp4split/mp4split+0x539cf7)
#4 0x7713f7 in AP4_DescriptorFactory::CreateDescriptorFromStream(AP4_ByteStream&, AP4_Descriptor*&) (/fuzz-mp4split/mp4split/mp4split+0x7713f7)
#5 0x4e9d46 in AP4_IodsAtom::Create(unsigned int, AP4_ByteStream&) (/fuzz-mp4split/mp4split/mp4split+0x4e9d46)
#6 0x4558fa in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x4558fa)
#7 0x462a0f in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/fuzz-mp4split/mp4split/mp4split+0x462a0f)
#8 0x48ef27 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/fuzz-mp4split/mp4split/mp4split+0x48ef27)
#9 0x490c11 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/fuzz-mp4split/mp4split/mp4split+0x490c11)
SUMMARY: AddressSanitizer: 2750 byte(s) leaked in 39 allocation(s).
```
# Bug2
SEGV on unknown address 0x000000000028 in mp4decrypt:
```
root@23435332df4:/fuzz-mp4decrypt/mp4decrypt# ./mp4decrypt ../out/crashes/poc_decrypt_1 /dev/null
WARNING: atom serialized to fewer bytes than declared size
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2367709==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000028 (pc 0x0000005da294 bp 0x7ffcee6b84c0 sp 0x7ffcee6b6b60 T0)
==2367709==The signal is caused by a READ memory access.
==2367709==Hint: address points to the zero page.
#0 0x5da294 in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x5da294)
#1 0x5f795d in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x5f795d)
#2 0x414e8b in main (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x414e8b)
#3 0x7fdba0338c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#4 0x407b69 in _start (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x407b69)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/fuzz-mp4decrypt/mp4decrypt/mp4decrypt+0x5da294) in AP4_Processor::ProcessFragments(AP4_MoovAtom*, AP4_List<AP4_AtomLocator>&, AP4_ContainerAtom*, AP4_SidxAtom*, unsigned long long, AP4_ByteStream&, AP4_ByteStream&)
==2367709==ABORTING
```
# Bug3
Detected memory leaks in mp4mux:
```
root@wha446aq:/# ./Bento4/cmakebuild/mp4mux --track h264:poc_mp4mux_1 /dev/null
ERROR: Feed() failed (-10)
=================================================================
==17429==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 148 byte(s) in 1 object(s) allocated from:
#0 0x4f5ce8 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x52d6b2 in AP4_AvcFrameParser::Feed(unsigned char const*, unsigned int, AP4_AvcFrameParser::AccessUnitInfo&, bool) (/Bento4/cmakebuild/mp4mux+0x52d6b2)
SUMMARY: AddressSanitizer: 148 byte(s) leaked in 1 allocation(s).
```
# POC
[Bug_1_POC.zip](https://github.com/axiomatic-systems/Bento4/files/9635069/Bug_1_POC.zip)
[Bug_2_POC.zip](https://github.com/axiomatic-systems/Bento4/files/9635073/Bug_2_POC.zip)
[Bug_3_POC.zip](https://github.com/axiomatic-systems/Bento4/files/9635075/Bug_3_POC.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Yuhang Huang ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Jiayuan Zhang ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Thank you for your time!
| Some vulnerabilities about mp4xx can cause serious errors | https://api.github.com/repos/axiomatic-systems/Bento4/issues/772/comments | 0 | 2022-09-23T15:37:03Z | 2023-06-26T05:24:50Z | https://github.com/axiomatic-systems/Bento4/issues/772 | 1,383,983,547 | 772 |
[
"axiomatic-systems",
"Bento4"
] | Hi, I use my fuzzer for fuzzing binary mp4decrypt, and a crash incurred shows that.
```
=================================================================
==1732==ERROR: LeakSanitizer: detected memory leaks
Indirect leak of 512 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5c2959 in AP4_Array<AP4_SttsTableEntry>::EnsureCapacity(unsigned int) /Bento4/Source/C++/Core/Ap4Array.h:172:25
#2 0x5c2959 in AP4_Array<AP4_SttsTableEntry>::Append(AP4_SttsTableEntry const&) /Bento4/Source/C++/Core/Ap4Array.h:252:29
......
#14 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#15 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 240 byte(s) in 3 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5315ca in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:16
#2 0x4fb6ff in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
......
#6 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#7 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 216 byte(s) in 9 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x53232c in AP4_List<AP4_Atom>::Add(AP4_Atom*) /Bento4/Source/C++/Core/Ap4List.h:160:16
#2 0x53232c in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:197:20
......
#9 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#10 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 152 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x4fb7cf in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:319:20
......
#14 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#15 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 128 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x4fff21 in AP4_AvccAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4AvccAtom.cpp:95:12
......
#5 0x5ada04 in AP4_VisualSampleEntry::AP4_VisualSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4SampleEntry.cpp:884:5
#6 0x5ada04 in AP4_AvcSampleEntry::AP4_AvcSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4SampleEntry.cpp:1136:5
Indirect leak of 104 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5bc445 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4StsdAtom.cpp:57:12
......
#11 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#12 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5515a3 in AP4_HdlrAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4HdlrAtom.cpp:52:12
......
#16 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#17 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x548f14 in AP4_DrefAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4DrefAtom.cpp:50:12
......
#11 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#12 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5315ca in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:16
......
#22 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#23 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5c2573 in AP4_SttsAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4SttsAtom.cpp:52:12
......
#11 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#12 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5315ca in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:16
......
#16 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#17 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5319ec in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:86:16
......
#11 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#12 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 73 byte(s) in 3 object(s) allocated from:
#0 0x4f4688 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x545fc2 in AP4_DataBuffer::ReallocateBuffer(unsigned int) /Bento4/Source/C++/Core/Ap4DataBuffer.cpp:210:28
#2 0x545fc2 in AP4_DataBuffer::SetData(unsigned char const*, unsigned int) /Bento4/Source/C++/Core/Ap4DataBuffer.cpp:169:33
Indirect leak of 72 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5c0d43 in AP4_StszAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4StszAtom.cpp:52:12
......
#11 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#12 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 72 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x533d57 in AP4_CttsAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4CttsAtom.cpp:52:12
......
#11 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#12 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 72 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5bfb73 in AP4_StssAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4StssAtom.cpp:52:12
......
#11 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#12 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 56 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5f44b7 in AP4_MetaDataAtomTypeHandler::CreateAtom(unsigned int, unsigned int, AP4_ByteStream&, unsigned int, AP4_Atom*&) /Bento4/Source/C++/MetaData/Ap4MetaData.cpp:424:20
......
#27 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#28 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 56 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5b7d73 in AP4_StcoAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4StcoAtom.cpp:52:12
......
#11 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#12 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 56 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5d8913 in AP4_UrlAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4UrlAtom.cpp:47:12
......
#15 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#16 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 48 byte(s) in 2 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x53232c in AP4_List<AP4_Atom>::Add(AP4_Atom*) /Bento4/Source/C++/Core/Ap4List.h:160:16
......
#14 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#15 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5fd5c2 in AP4_DataAtom::AP4_DataAtom(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/MetaData/Ap4MetaData.cpp:1446:16
......
#28 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#29 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x534051 in AP4_Array<AP4_CttsTableEntry>::EnsureCapacity(unsigned int) /Bento4/Source/C++/Core/Ap4Array.h:172:25
......
#14 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#15 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5ff89f in AP4_StdcFileByteStream::Create(AP4_FileByteStream*, char const*, AP4_FileByteStream::Mode, AP4_ByteStream*&) /Bento4/Source/C++/System/StdC/Ap4StdCFileByteStream.cpp:279:14
Indirect leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x501c33 in AP4_Array<AP4_DataBuffer>::EnsureCapacity(unsigned int) /Bento4/Source/C++/Core/Ap4Array.h:172:25
......
#7 0x5ada04 in AP4_VisualSampleEntry::AP4_VisualSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4SampleEntry.cpp:884:5
#8 0x5ada04 in AP4_AvcSampleEntry::AP4_AvcSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4SampleEntry.cpp:1136:5
Indirect leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x501f85 in AP4_Array<AP4_DataBuffer>::EnsureCapacity(unsigned int) /Bento4/Source/C++/Core/Ap4Array.h:172:25
......
#7 0x5ada04 in AP4_VisualSampleEntry::AP4_VisualSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4SampleEntry.cpp:884:5
#8 0x5ada04 in AP4_AvcSampleEntry::AP4_AvcSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4SampleEntry.cpp:1136:5
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x53232c in AP4_List<AP4_Atom>::Add(AP4_Atom*) /Bento4/Source/C++/Core/Ap4List.h:160:16
......
#25 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#26 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x4f4688 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x5b7fef in AP4_StcoAtom::AP4_StcoAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4StcoAtom.cpp:86:17
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5c1207 in AP4_Array<unsigned int>::EnsureCapacity(unsigned int) /Bento4/Source/C++/Core/Ap4Array.h:172:25
......
#14 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#15 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5495a0 in AP4_List<AP4_Atom>::Add(AP4_Atom*) /Bento4/Source/C++/Core/Ap4List.h:160:16
......
#13 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#14 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5bd2e8 in AP4_List<AP4_Atom>::Add(AP4_Atom*) /Bento4/Source/C++/Core/Ap4List.h:160:16
......
#13 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#14 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x53232c in AP4_List<AP4_Atom>::Add(AP4_Atom*) /Bento4/Source/C++/Core/Ap4List.h:160:16
......
#19 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#20 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x53232c in AP4_List<AP4_Atom>::Add(AP4_Atom*) /Bento4/Source/C++/Core/Ap4List.h:160:16
......
#4 0x5ada04 in AP4_AvcSampleEntry::AP4_AvcSampleEntry(unsigned int, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /Bento4/Source/C++/Core/Ap4SampleEntry.cpp:1136:5
Indirect leak of 20 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5b9ea7 in AP4_Array<AP4_StscTableEntry>::EnsureCapacity(unsigned int) /Bento4/Source/C++/Core/Ap4Array.h:172:25
......
#14 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#15 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5bd4ea in AP4_Array<AP4_SampleDescription*>::EnsureCapacity(unsigned int) /Bento4/Source/C++/Core/Ap4Array.h:172:25
......
#13 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#14 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 4 byte(s) in 1 object(s) allocated from:
#0 0x4f4528 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x5bff41 in AP4_Array<unsigned int>::EnsureCapacity(unsigned int) /Bento4/Source/C++/Core/Ap4Array.h:172:25
......
#14 0x4f894a in main /Bento4/Source/C++/Apps/Mp4Decrypt/Mp4Decrypt.cpp:258:29
#15 0x7f1c98501c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 2 byte(s) in 2 object(s) allocated from:
#0 0x4f4688 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x5b93f5 in AP4_String::Assign(char const*, unsigned int) /Bento4/Source/C++/Core/Ap4String.cpp:165:15
#2 0x5b93f5 in AP4_String::operator=(char const*) /Bento4/Source/C++/Core/Ap4String.cpp:123:9
SUMMARY: AddressSanitizer: 2827 byte(s) leaked in 51 allocation(s).
```
## System Details
Test Machine: Ubuntu 18.04 (docker)
Project Name: mp4decrypt (Bento4-master)
## Commit ID
[5b7cc25](https://github.com/axiomatic-systems/Bento4/commit/5b7cc2500d514717a64675fcf631939494c074ce)
## Poc
[mp4decrypt_Poc.zip](https://github.com/axiomatic-systems/Bento4/files/9631998/mp4decrypt_Poc.zip)
## Command
./mp4decrypt mp4decrypt_Poc /dev/null
## Credit
Wanying Cao (NCNIPC of China)
Xudong Cao (NCNIPC of China)
Hao Zhang (NCNIPC of China)
Xiaotong Jiao (NCNIPC of China)
Han Zheng (NCNIPC of China, [Hexhive](http://hexhive.epfl.ch/)) | The binary mp4decrypt has a memory leak vulnerability | https://api.github.com/repos/axiomatic-systems/Bento4/issues/771/comments | 0 | 2022-09-23T08:27:08Z | 2023-05-29T02:51:12Z | https://github.com/axiomatic-systems/Bento4/issues/771 | 1,383,462,683 | 771 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hello, I use my fuzzer to fuzz binary mp4tag , the three binary all crashede, and shows that allocator is out of memory trying to allocate 0xxxxxxx bytes. Then I use the crash input to test binary mpesplit and mp42hevc,and all crashed beacuse of same situation. The version of Bento4 is the latest commit[5b7cc25](https://github.com/axiomatic-systems/Bento4/commit/5b7cc2500d514717a64675fcf631939494c074ce) and the operation system is Ubuntu 18.04(docker). The following is the details.And the issue is different from #342. Beacuse I test the poc,and it didn't work.
# Bug1
```
root@76fc65f1cc2f:/Bento4/build# ./mp4tag crash_1.mp4
=================================================================
==206601==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0xfffeffee bytes
#0 0x4f4778 in operator new[](unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x532595 in AP4_DataBuffer::ReallocateBuffer(unsigned int) /Bento4/Source/C++/Core/Ap4DataBuffer.cpp:210:28
#2 0x532595 in AP4_DataBuffer::SetDataSize(unsigned int) /Bento4/Source/C++/Core/Ap4DataBuffer.cpp:151:33
==206601==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102 in operator new[](unsigned long)
==206601==ABORTING
```
# Bug2
```
root@76fc65f1cc2f:/Bento4/build# ./mp4tag crash_2.mp4
=================================================================
==233834==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x1fffffff8 bytes
#0 0x4f4618 in operator new(unsigned long) /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99
#1 0x537e3d in AP4_Array<AP4_ElstEntry>::EnsureCapacity(unsigned int) /Bento4/Source/C++/Core/Ap4Array.h:172:25
#2 0x537e3d in AP4_ElstAtom::AP4_ElstAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4ElstAtom.cpp:87:15
#3 0x537b15 in AP4_ElstAtom::Create(unsigned int, AP4_ByteStream&) /Bento4/Source/C++/Core/Ap4ElstAtom.cpp:51:16
#4 0x50e244 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:590:20
#5 0x50cfd4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
#6 0x50c7fe in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
#7 0x53a50e in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /Bento4/Source/C++/Core/Ap4File.cpp:104:12
#8 0x53a9ed in AP4_File::AP4_File(AP4_ByteStream&, bool) /Bento4/Source/C++/Core/Ap4File.cpp:78:5
#9 0x4f9403 in main /Bento4/Source/C++/Apps/Mp4Tag/Mp4Tag.cpp:821:20
#10 0x7f0a40dd5c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
==233834==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory /llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99 in operator new(unsigned long)
==233834==ABORTING
```
# Environment
clang 11.0.1
clang++ 11.0.1
version:master branch(commit[5b7cc25](https://github.com/axiomatic-systems/Bento4/commit/5b7cc2500d514717a64675fcf631939494c074ce))
# Platform
```
$ uname -a
Linux kali 5.10.0-kali9-amd64 #1 SMP Debian 5.10.46-4kali1 (2021-08-09) x86_64 GNU/Linux
```
# How to compile
```
export CC=clang
export CXX=clang++
export CFLAGS="-fsanitize=address -g"
export CXXFLAGS="-fsanitize=address -g"
mkdir cmakebuild
cd cmakebuild
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
# POC
[crash.zip](https://github.com/axiomatic-systems/Bento4/files/9631277/crash.zip)
# NOTE
I find the two bugs not only exist in latest branch but also exist in latest release version Bento4-1.6.0-639.
# Credit
Yuhang Huang ([NCNIPC of China](http://www.nipc.org.cn/)),(Zhongguancun Laboratory)
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/)),(Zhongguancun Laboratory)
Yin li,Jiayuan Zhang([NCNIPC of China](http://www.nipc.org.cn/)),(Zhongguancun Laboratory)
Thansk for your time! | there are some vulnerabilities in binary mp4tag | https://api.github.com/repos/axiomatic-systems/Bento4/issues/770/comments | 0 | 2022-09-23T07:02:26Z | 2023-06-26T06:33:03Z | https://github.com/axiomatic-systems/Bento4/issues/770 | 1,383,377,290 | 770 |
[
"axiomatic-systems",
"Bento4"
] | Hi, there.
There is a segmentation fault caused by null pointer dereference in MP4fragment, Ap4MdhdAtom.cpp:69 in the newest commit 5b7cc250.
The reason for this issue is that the pointer of the parameter language is unchecked.
<img width="798" alt="image" src="https://user-images.githubusercontent.com/7632714/191883685-de179dff-fa13-47ea-ac20-282f4ac815dd.png">
To reproduce, run:
~~~~
./mp4fragment poc /dev/null
~~~~
Here is the trace reported by ASAN:
~~~~
==2203836==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f7614ee06e5 bp 0x7fffa38827d0 sp 0x7fffa3881f68 T0)
==2203836==The signal is caused by a READ memory access.
==2203836==Hint: address points to the zero page.
#0 0x7f7614ee06e5 /build/glibc-SzIz7B/glibc-2.31/string/../sysdeps/x86_64/multiarch/strlen-avx2.S:65
#1 0x46efac in __interceptor_strlen.part.0 /dependence/llvm11/llvm-11.0.0.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:370:31
#2 0x590708 in AP4_MdhdAtom::AP4_MdhdAtom(unsigned long long, unsigned long long, unsigned int, unsigned long long, char const*) /benchmark/Bento4/Source/C++/Core/Ap4MdhdAtom.cpp:69:9
#3 0x621124 in AP4_TrakAtom::AP4_TrakAtom(AP4_SampleTable*, unsigned int, char const*, unsigned int, unsigned long long, unsigned long long, unsigned long long, unsigned int, unsigned long long, unsigned short, char const*, unsigned int, unsigned int, unsigned short, unsigned short, int const*) /benchmark/Bento4/Source/C++/Core/Ap4TrakAtom.cpp:143:22
#4 0x61e255 in AP4_Track::AP4_Track(AP4_SampleTable*, unsigned int, unsigned int, unsigned long long, unsigned int, unsigned long long, AP4_Track const*) /benchmark/Bento4/Source/C++/Core/Ap4Track.cpp:183:22
#5 0x500733 in Fragment(AP4_File&, AP4_ByteStream&, AP4_Array<TrackCursor*>&, unsigned int, unsigned int, bool, bool, bool) /benchmark/Bento4/Source/C++/Apps/Mp4Fragment/Mp4Fragment.cpp:360:39
#6 0x500733 in main /benchmark/Bento4/Source/C++/Apps/Mp4Fragment/Mp4Fragment.cpp:1475:5
#7 0x7f7614d7c082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#8 0x41d8ad in _start (/benchmark/Bento4/build-a/mp4fragment+0x41d8ad)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /build/glibc-SzIz7B/glibc-2.31/string/../sysdeps/x86_64/multiarch/strlen-avx2.S:65
==2203836==ABORTING
~~~~
[poc.zip](https://github.com/axiomatic-systems/Bento4/files/9630471/mp4fragment_npd_Ap4MdhdAtom69.zip)
(unzip first) | Segmentation fault caused by null pointer dereference in MP4fragment, Ap4MdhdAtom.cpp:69 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/769/comments | 0 | 2022-09-23T02:55:37Z | 2023-05-29T02:51:11Z | https://github.com/axiomatic-systems/Bento4/issues/769 | 1,383,231,551 | 769 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hi there, I tested the binary mp42hls, the version of Bento4 is the latest (the newest master branch) and the operation system is Ubuntu 18.04.6 LTS (docker) and this binary crash with the following.
# Details
```
root@2e47aa8b3277:/test_mp42hls# ./mp42hls --audio-track-id 2 ./mp42hls\-poc\-1
ERROR: audio track ID 2 not found
=================================================================
==4379==ERROR: LeakSanitizer: detected memory leaks
Indirect leak of 512 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x6d951f in AP4_SttsAtom::Create(unsigned int, AP4_ByteStream&) (/test_mp42hls/mp42hls+0x6d951f)
#3 0x4bb0c3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4bb0c3)
#4 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#5 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#6 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#7 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#8 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#9 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#10 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#11 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#12 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#13 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#14 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#15 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#16 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#17 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#18 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 324 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x6d10ef in AP4_StszAtom::Create(unsigned int, AP4_ByteStream&) (/test_mp42hls/mp42hls+0x6d10ef)
#3 0x4bae13 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4bae13)
#4 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#5 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#6 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#7 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#8 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#9 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#10 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#11 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#12 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#13 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#14 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#15 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#16 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#17 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#18 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 312 byte(s) in 8 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x53c1a4 in AP4_File::AP4_File(AP4_ByteStream&, bool) (/test_mp42hls/mp42hls+0x53c1a4)
#3 0x4222e1 in main (/test_mp42hls/mp42hls+0x4222e1)
#4 0x7f476e4f2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 256 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4bf01d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4bf01d)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4c78bc in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c78bc)
#5 0x53a38e in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) (/test_mp42hls/mp42hls+0x53a38e)
#6 0x53c1a4 in AP4_File::AP4_File(AP4_ByteStream&, bool) (/test_mp42hls/mp42hls+0x53c1a4)
#7 0x4222e1 in main (/test_mp42hls/mp42hls+0x4222e1)
#8 0x7f476e4f2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 240 byte(s) in 3 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 192 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#3 0x6c5538 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x6c5538)
#4 0x6c48d2 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x6c48d2)
#5 0x4ba8b3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4ba8b3)
#6 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#7 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#8 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#9 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#10 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#11 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#12 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#13 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#14 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#15 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#16 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#17 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#18 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#19 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#20 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 192 byte(s) in 2 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#3 0x4c78bc in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c78bc)
#4 0x53a38e in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) (/test_mp42hls/mp42hls+0x53a38e)
#5 0x53c1a4 in AP4_File::AP4_File(AP4_ByteStream&, bool) (/test_mp42hls/mp42hls+0x53c1a4)
#6 0x4222e1 in main (/test_mp42hls/mp42hls+0x4222e1)
#7 0x7f476e4f2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 176 byte(s) in 2 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c78bc in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c78bc)
#3 0x53a38e in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) (/test_mp42hls/mp42hls+0x53a38e)
#4 0x53c1a4 in AP4_File::AP4_File(AP4_ByteStream&, bool) (/test_mp42hls/mp42hls+0x53c1a4)
#5 0x4222e1 in main (/test_mp42hls/mp42hls+0x4222e1)
#6 0x7f476e4f2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 160 byte(s) in 2 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#6 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#9 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#10 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#11 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#12 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#13 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 152 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4b8f63 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4b8f63)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 144 byte(s) in 6 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#3 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#4 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#5 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#6 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#7 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#8 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#9 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#10 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#11 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#12 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#13 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#14 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 144 byte(s) in 6 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 136 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4ba099 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4ba099)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 120 byte(s) in 2 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x7f476e4f2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 120 byte(s) in 5 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#3 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#4 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#5 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#6 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 104 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4ba8b3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4ba8b3)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#6 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#9 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#10 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#11 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#12 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#13 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#14 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#15 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#16 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#17 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 104 byte(s) in 2 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x868704 in AP4_EsDescriptor::AP4_EsDescriptor(AP4_ByteStream&, unsigned int, unsigned int) (/test_mp42hls/mp42hls+0x868704)
#3 0x85d250 in AP4_DescriptorFactory::CreateDescriptorFromStream(AP4_ByteStream&, AP4_Descriptor*&) (/test_mp42hls/mp42hls+0x85d250)
#4 0x537d62 in AP4_EsdsAtom::Create(unsigned int, AP4_ByteStream&) (/test_mp42hls/mp42hls+0x537d62)
#5 0x4bb623 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4bb623)
#6 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#7 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#8 0x672a2e in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x672a2e)
#9 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#10 0x6c5538 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x6c5538)
#11 0x6c48d2 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x6c48d2)
#12 0x4ba8b3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4ba8b3)
#13 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#14 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#15 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#16 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#17 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#18 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#19 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#20 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#21 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#22 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#23 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#24 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#25 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#26 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#27 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 101 byte(s) in 2 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4b9f41 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4b9f41)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#6 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#9 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 96 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#3 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#4 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 89 byte(s) in 2 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4b9f41 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4b9f41)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fbb89 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fbb89)
#6 0x4c48ca in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c48ca)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#9 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#10 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#11 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#12 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#13 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x537d62 in AP4_EsdsAtom::Create(unsigned int, AP4_ByteStream&) (/test_mp42hls/mp42hls+0x537d62)
#3 0x4bb623 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4bb623)
#4 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#5 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#6 0x672a2e in AP4_SampleEntry::Read(AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x672a2e)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x6c5538 in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x6c5538)
#9 0x6c48d2 in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x6c48d2)
#10 0x4ba8b3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4ba8b3)
#11 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#12 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#13 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#14 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#15 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#16 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#17 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#18 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#19 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#20 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#21 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#22 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#23 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#24 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#25 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4ba751 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4ba751)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#6 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#9 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fbb89 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fbb89)
#6 0x4c48ca in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c48ca)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#9 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#10 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#11 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#12 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#13 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x78dd17 in AP4_MetaDataAtomTypeHandler::CreateAtom(unsigned int, unsigned int, AP4_ByteStream&, unsigned int, AP4_Atom*&) (/test_mp42hls/mp42hls+0x78dd17)
#3 0x4c511b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c511b)
#4 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#5 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#6 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#7 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#8 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#9 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#10 0x4fbb89 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fbb89)
#11 0x4c48ca in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c48ca)
#12 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#13 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#14 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#15 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#16 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#17 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#18 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c48ca in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c48ca)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#6 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#9 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4bb0c3 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4bb0c3)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#6 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#9 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#10 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#11 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#12 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#13 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#14 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#15 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#16 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#17 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4bdf2b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4bdf2b)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#6 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#9 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#10 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#11 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#12 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#13 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#14 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#15 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#16 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#17 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#3 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#4 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#5 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#6 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#7 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#8 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#9 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
……
Indirect leak of 20 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x6b73af in AP4_StscAtom::Create(unsigned int, AP4_ByteStream&) (/test_mp42hls/mp42hls+0x6b73af)
#3 0x4baa0b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4baa0b)
#4 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#5 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#6 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#7 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#8 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#9 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#10 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#11 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#12 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#13 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#14 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#15 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#16 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#17 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#18 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
Indirect leak of 4 byte(s) in 1 object(s) allocated from:
#0 0x9def30 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7f476f32e297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x5ab4ab in AP4_MdhdAtom::Create(unsigned int, AP4_ByteStream&) (/test_mp42hls/mp42hls+0x5ab4ab)
#3 0x4ba751 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4ba751)
#4 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#5 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#6 0x4fc2da in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fc2da)
#7 0x4c4421 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c4421)
#8 0x4c9f46 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) (/test_mp42hls/mp42hls+0x4c9f46)
#9 0x4fcb35 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) (/test_mp42hls/mp42hls+0x4fcb35)
#10 0x4fedeb in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) (/test_mp42hls/mp42hls+0x4fedeb)
SUMMARY: AddressSanitizer: 5306 byte(s) leaked in 88 allocation(s).
```
# POC
[mp42hls-poc.zip](https://github.com/axiomatic-systems/Bento4/files/9618647/mp42hls-poc.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Mengyue Feng ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Thank you for your time!
| Detected memory leaks in mp42hls | https://api.github.com/repos/axiomatic-systems/Bento4/issues/768/comments | 0 | 2022-09-21T16:36:04Z | 2023-06-26T05:25:33Z | https://github.com/axiomatic-systems/Bento4/issues/768 | 1,381,208,895 | 768 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hi there, I use my fuzzer for fuzzing the binary mp4fragment, the version of Bento4 is the latest (the newest master branch) and the operation system is Ubuntu 18.04.6 LTS (docker) and this binary crashes with the following.
# Details
```
root@4e3b7f9edc0d:/mp4box/mp4fragment# ./mp4fragment ../out/crashes/id\:000000\,sig\:06\,src\:000008\,op\:flip1\,pos\:31325\,4970731 /dev/null
unable to autodetect fragment duration, using default
AddressSanitizer:DEADLYSIGNAL
=================================================================
==750986==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f5fc13c0306 bp 0x7ffe16f62f30 sp 0x7ffe16f626c8 T0)
==750986==The signal is caused by a READ memory access.
==750986==Hint: address points to the zero page.
#0 0x7f5fc13c0306 (/lib/x86_64-linux-gnu/libc.so.6+0xb1306)
#1 0x94da2c in __interceptor_strlen.part.36 /llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:370
#2 0x6ec0c2 in AP4_TrakAtom::AP4_TrakAtom(AP4_SampleTable*, unsigned int, char const*, unsigned int, unsigned long long, unsigned long long, unsigned long long, unsigned int, unsigned long long, unsigned short, char const*, unsigned int, unsigned int, unsigned short, unsigned short, int const*) (/mp4box/mp4fragment/mp4fragment+0x6ec0c2)
#3 0x432bbc in main (/mp4box/mp4fragment/mp4fragment+0x432bbc)
#4 0x7f5fc1330c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#5 0x407cd9 in _start (/mp4box/mp4fragment/mp4fragment+0x407cd9)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0xb1306)
==750986==ABORTING
```
# POC
[POC-Mp4fragment-1.zip](https://github.com/axiomatic-systems/Bento4/files/9617496/POC-Mp4fragment-1.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Jiayuan Zhang ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/))
Thank you for your time!
| From mp4fragment: SEGV on unknown address 0x000000000000 | https://api.github.com/repos/axiomatic-systems/Bento4/issues/767/comments | 0 | 2022-09-21T14:23:53Z | 2023-06-26T05:26:52Z | https://github.com/axiomatic-systems/Bento4/issues/767 | 1,381,022,528 | 767 |
[
"axiomatic-systems",
"Bento4"
] | # Summary
Hi, developers of Bento4:
I tested the binary mp4encrypt, and a crash incurred, i.e., memory leaks error. The version of Bento4 is the latest (the newest master branch) and the operation system is Ubuntu 18.04.6 LTS (docker). The following is the details.
# Details
```
root@c08635047aea:/fuzz-mp4encrypt/mp4encrypt# ./mp4encrypt --method MARLIN-IPMP-ACBC ../out/crashes/id\:000007\,sig\:06\,src\:000001\,op\:flip1\,pos\:14136\,934837 /dev/null
WARNING: track ID 1 will not be encrypted
WARNING: atom serialized to fewer bytes than declared size
=================================================================
==3055140==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 104 byte(s) in 1 object(s) allocated from:
#0 0x9a1c90 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fda31f4c297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x64923f in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x64923f)
#3 0x42128c in main (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x42128c)
#4 0x7fda31110c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 3328 byte(s) in 2 object(s) allocated from:
#0 0x9a1c90 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fda31f4c297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x5b2921 in AP4_MarlinIpmpEncryptingProcessor::Initialize(AP4_AtomParent&, AP4_ByteStream&, AP4_Processor::ProgressListener*) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x5b2921)
#3 0x64923f in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x64923f)
#4 0x42128c in main (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x42128c)
#5 0x7fda31110c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 1024 byte(s) in 1 object(s) allocated from:
#0 0x9a1c90 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fda31f4c297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x8b62f9 in AP4_Expandable::Write(AP4_ByteStream&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x8b62f9)
#3 0x5b2540 in AP4_MarlinIpmpEncryptingProcessor::Initialize(AP4_AtomParent&, AP4_ByteStream&, AP4_Processor::ProgressListener*) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x5b2540)
#4 0x64923f in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x64923f)
#5 0x42128c in main (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x42128c)
#6 0x7fda31110c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
Indirect leak of 224 byte(s) in 5 object(s) allocated from:
#0 0x9a1c90 in malloc /llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145
#1 0x7fda31f4c297 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x93297)
#2 0x64923f in AP4_Processor::Process(AP4_ByteStream&, AP4_ByteStream&, AP4_ByteStream*, AP4_Processor::ProgressListener*, AP4_AtomFactory&) (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x64923f)
#3 0x42128c in main (/fuzz-mp4encrypt/mp4encrypt/mp4encrypt+0x42128c)
#4 0x7fda31110c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
SUMMARY: AddressSanitizer: 4680 byte(s) leaked in 9 allocation(s).
```
# POC
[mp4encrypt_poc1.zip](https://github.com/axiomatic-systems/Bento4/files/9603334/mp4encrypt_poc1.zip)
# Environment
Ubuntu 18.04.6 LTS (docker)
clang 12.0.1
clang++ 12.0.1
Bento4 master branch(5b7cc25) && Bento4 release version([1.6.0-639](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-639.x86_64-unknown-linux.zip))
# Credit
Xudong Cao ([NCNIPC of China](http://www.nipc.org.cn/)), (Zhongguancun Laboratory)
Han Zheng ([NCNIPC of China](http://www.nipc.org.cn/), [Hexhive](http://hexhive.epfl.ch/)), (Zhongguancun Laboratory)
Thank you for your time!
| Detected memory leaks in mp4encrypt | https://api.github.com/repos/axiomatic-systems/Bento4/issues/766/comments | 0 | 2022-09-20T01:45:02Z | 2023-06-26T05:57:20Z | https://github.com/axiomatic-systems/Bento4/issues/766 | 1,378,706,570 | 766 |
[
"axiomatic-systems",
"Bento4"
] | Hi, developers of Bento4:
In the test of the binary mp42aac instrumented with ASAN. There are some inputs causing attempting free on address which was not malloc. Here is the ASAN mode output:
==9252==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x60200000ef50 in thread T0
#0 0x7ffff6f03d0a in operator delete[](void*) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99d0a)
#1 0x5c124b in AP4_HdlrAtom::~AP4_HdlrAtom() /root/Bento4/Source/C++/Core/Ap4HdlrAtom.h:61
#2 0x5c124b in AP4_HdlrAtom::~AP4_HdlrAtom() /root/Bento4/Source/C++/Core/Ap4HdlrAtom.h:61
#3 0x4e7e4b in AP4_List<AP4_Atom>::DeleteReferences() /root/Bento4/Source/C++/Core/Ap4List.h:476
#4 0x4e7e4b in AP4_AtomParent::~AP4_AtomParent() /root/Bento4/Source/C++/Core/Ap4Atom.cpp:516
#5 0x57a323 in AP4_ContainerAtom::~AP4_ContainerAtom() /root/Bento4/Source/C++/Core/Ap4ContainerAtom.h:48
#6 0x57a323 in AP4_ContainerAtom::~AP4_ContainerAtom() /root/Bento4/Source/C++/Core/Ap4ContainerAtom.h:48
#7 0x4e7e4b in AP4_List<AP4_Atom>::DeleteReferences() /root/Bento4/Source/C++/Core/Ap4List.h:476
#8 0x4e7e4b in AP4_AtomParent::~AP4_AtomParent() /root/Bento4/Source/C++/Core/Ap4Atom.cpp:516
#9 0x417b8d in AP4_File::~AP4_File() /root/Bento4/Source/C++/Core/Ap4File.cpp:84
#10 0x417b8d in AP4_File::~AP4_File() /root/Bento4/Source/C++/Core/Ap4File.cpp:88
#11 0x4043f2 in main /root/Bento4/Source/C++/Apps/Mp42Aac/Mp42Aac.cpp:303
#12 0x7ffff61bb83f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#13 0x408508 in _start (/root/Bento4/mp42aac+0x408508)
0x60200000ef50 is located 0 bytes inside of 1-byte region [0x60200000ef50,0x60200000ef51)
allocated by thread T0 here:
#0 0x7ffff6f03712 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99712)
#1 0x48ac75 in AP4_String::Assign(char const*, unsigned int) /root/Bento4/Source/C++/Core/Ap4String.cpp:165
#2 0x48ac75 in AP4_String::operator=(char const*) /root/Bento4/Source/C++/Core/Ap4String.cpp:123
SUMMARY: AddressSanitizer: bad-free ??:0 operator delete[](void*)
==9252==ABORTING
### Crash input
https://github.com/17ssDP/fuzzer_crashes/blob/main/Bento4/mp42aac-badfree
### Validation 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
./mp42aac mp42aac-badfree /dev/null
### Environment
Ubuntu 16.04
Clang 10.0.1
gcc 5.5 | Bad-free with ASAN in mp42aac | https://api.github.com/repos/axiomatic-systems/Bento4/issues/765/comments | 0 | 2022-09-19T06:29:50Z | 2023-05-29T02:51:08Z | https://github.com/axiomatic-systems/Bento4/issues/765 | 1,377,466,423 | 765 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.