Skip to content

Memory leak in Bento4/Source/C++/Core/Ap4List.h:160 #1025

@MetamorphicAgg

Description

@MetamorphicAgg

Memory leak in Bento4/Source/C++/Core/Ap4List.h:160

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_006.poc /dev/null

Output:

ERROR: no video track found

=================================================================
==979989==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x55e342fb2f31 in operator new(unsigned long) (/home/exp/bin/asan_ubsan/mp42hevc+0x2f2f31) (BuildId: 72913d137b17319d7173795b406f1ca606be691a)
    #1 0x55e342fd4c2f in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4File.cpp:108:27
    #2 0x55e342fd5819 in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4File.cpp:78:5
    #3 0x55e342fb5e53 in main /home/exp/src/bento4/Bento4/Source/C++/Apps/Mp42Hevc/Mp42Hevc.cpp:374:32
    #4 0x7f7b78c2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #5 0x7f7b78c2a28a in __libc_start_main csu/../csu/libc-start.c:360:3
    #6 0x55e342ef3514 in _start (/home/exp/bin/asan_ubsan/mp42hevc+0x233514) (BuildId: 72913d137b17319d7173795b406f1ca606be691a)

Indirect leak of 176 byte(s) in 2 object(s) allocated from:
    #0 0x55e342fb2f31 in operator new(unsigned long) (/home/exp/bin/asan_ubsan/mp42hevc+0x2f2f31) (BuildId: 72913d137b17319d7173795b406f1ca606be691a)
    #1 0x55e34307dc7c in AP4_Track::AP4_Track(AP4_TrakAtom&, AP4_ByteStream&, unsigned int) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4Track.cpp:244:25
    #2 0x55e342ff6f8e in AP4_Movie::AP4_Movie(AP4_MoovAtom*, AP4_ByteStream&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4Movie.cpp:118:32
    #3 0x55e342fd4e42 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4File.cpp:108:31
    #4 0x55e342fd5819 in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4File.cpp:78:5
    #5 0x55e342fb5e53 in main /home/exp/src/bento4/Bento4/Source/C++/Apps/Mp42Hevc/Mp42Hevc.cpp:374:32
    #6 0x7f7b78c2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #7 0x7f7b78c2a28a in __libc_start_main csu/../csu/libc-start.c:360:3
    #8 0x55e342ef3514 in _start (/home/exp/bin/asan_ubsan/mp42hevc+0x233514) (BuildId: 72913d137b17319d7173795b406f1ca606be691a)

Indirect leak of 80 byte(s) in 2 object(s) allocated from:
    #0 0x55e342fb2f31 in operator new(unsigned long) (/home/exp/bin/asan_ubsan/mp42hevc+0x2f2f31) (BuildId: 72913d137b17319d7173795b406f1ca606be691a)
    #1 0x55e342ff6e66 in AP4_Movie::AP4_Movie(AP4_MoovAtom*, AP4_ByteStream&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4Movie.cpp:118:28
    #2 0x55e342fd4e42 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4File.cpp:108:31
    #3 0x55e342fd5819 in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4File.cpp:78:5
    #4 0x55e342fb5e53 in main /home/exp/src/bento4/Bento4/Source/C++/Apps/Mp42Hevc/Mp42Hevc.cpp:374:32
    #5 0x7f7b78c2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #6 0x7f7b78c2a28a in __libc_start_main csu/../csu/libc-start.c:360:3
    #7 0x55e342ef3514 in _start (/home/exp/bin/asan_ubsan/mp42hevc+0x233514) (BuildId: 72913d137b17319d7173795b406f1ca606be691a)

Indirect leak of 48 byte(s) in 2 object(s) allocated from:
    #0 0x55e342fb2f31 in operator new(unsigned long) (/home/exp/bin/asan_ubsan/mp42hevc+0x2f2f31) (BuildId: 72913d137b17319d7173795b406f1ca606be691a)
    #1 0x55e342ffa755 in AP4_List<AP4_Track>::Add(AP4_Track*) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4List.h:160:16
    #2 0x55e342ff712c in AP4_Movie::AP4_Movie(AP4_MoovAtom*, AP4_ByteStream&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4Movie.cpp:121:18
    #3 0x55e342fd4e42 in AP4_File::ParseStream(AP4_ByteStream&, AP4_AtomFactory&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4File.cpp:108:31
    #4 0x55e342fd5819 in AP4_File::AP4_File(AP4_ByteStream&, bool) /home/exp/src/bento4/Bento4/Source/C++/Core/Ap4File.cpp:78:5
    #5 0x55e342fb5e53 in main /home/exp/src/bento4/Bento4/Source/C++/Apps/Mp42Hevc/Mp42Hevc.cpp:374:32
    #6 0x7f7b78c2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #7 0x7f7b78c2a28a in __libc_start_main csu/../csu/libc-start.c:360:3
    #8 0x55e342ef3514 in _start (/home/exp/bin/asan_ubsan/mp42hevc+0x233514) (BuildId: 72913d137b17319d7173795b406f1ca606be691a)

SUMMARY: AddressSanitizer: 368 byte(s) leaked in 7 allocation(s).

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