Skip to content

Division by zero in Bento4/Source/C++/Core/Ap4TfraAtom.cpp:153 #1020

@MetamorphicAgg

Description

@MetamorphicAgg

Division by zero in Bento4/Source/C++/Core/Ap4TfraAtom.cpp:153

Environment:

Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04

Compiler:

Ubuntu clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix

Compiling:

mkdir build && cd build
cmake -DCMAKE_CXX_FLAGS_RELEASE="-fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -g" ..
make

Version:

commit 3bdc891

PoCfile:

Unzip the following file.

poc.zip

Behavior:

./mp42hevc poc/bento4_001.poc /dev/null

Output:

/home/exp/src/bento4/Bento4/Source/C++/Core/Ap4TfraAtom.cpp:153:53: runtime error: division by zero
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4TfraAtom.cpp:153:53 in 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==926932==ERROR: AddressSanitizer: FPE on unknown address 0x5627a7f5d61b (pc 0x5627a7f5d61b bp 0x7fff9c605df0 sp 0x7fff9c605500 T0)
    #0 0x5627a7f5d61b in AP4_TfraAtom::AP4_TfraAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4TfraAtom.cpp:153:53
    #1 0x5627a7f5c1c2 in AP4_TfraAtom::Create(unsigned int, AP4_ByteStream&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4TfraAtom.cpp:53:16
    #2 0x5627a7d360c4 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:443:20
    #3 0x5627a7d31576 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
    #4 0x5627a7dceadc in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:196:12
    #5 0x5627a7dce617 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:140:5
    #6 0x5627a7dcd856 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:88:20
    #7 0x5627a7d3bf66 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:816:20
    #8 0x5627a7d31576 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
    #9 0x5627a7dceadc in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:196:12
    #10 0x5627a7dce617 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:140:5
    #11 0x5627a7c81290 in AP4_TrakAtom::AP4_TrakAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4TrakAtom.cpp:165:5
    #12 0x5627a7d3f1bd in AP4_TrakAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4TrakAtom.h:58:20
    #13 0x5627a7d35944 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:413:20
    #14 0x5627a7d31576 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
    #15 0x5627a7dceadc in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&, AP4_ByteStream&, unsigned long long) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:196:12
    #16 0x5627a7dce617 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&, AP4_AtomFactory&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4ContainerAtom.cpp:140:5
    #17 0x5627a7bebeb6 in AP4_MoovAtom::AP4_MoovAtom(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4MoovAtom.cpp:79:5
    #18 0x5627a7d3f0ad in AP4_MoovAtom::Create(unsigned int, AP4_ByteStream&, AP4_AtomFactory&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4MoovAtom.h:56:20
    #19 0x5627a7d35407 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned int, unsigned int, unsigned long long, AP4_Atom*&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:393:20
    #20 0x5627a7d31576 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, unsigned long long&, AP4_Atom*&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:234:14
    #21 0x5627a7d2fe75 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&, AP4_Atom*&) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4AtomFactory.cpp:154:12
    #22 0x5627a7bce92c in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4File.cpp:104:12
    #23 0x5627a7bcf819 in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4File.cpp:78:5
    #24 0x5627a7bafe53 in main /home/exp/src/bento4/Bento4/Source/C++/Apps/Mp42Hevc/Mp42Hevc.cpp:374:32
    #25 0x7f8427a2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #26 0x7f8427a2a28a in __libc_start_main csu/../csu/libc-start.c:360:3
    #27 0x5627a7aed514 in _start (/home/exp/bin/asan_ubsan/mp42hevc+0x233514) (BuildId: 72913d137b17319d7173795b406f1ca606be691a)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4TfraAtom.cpp:153:53 in AP4_TfraAtom::AP4_TfraAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&)
==926932==ABORTING

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions