Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile error with gcc-15 #1421

Open
heitbaum opened this issue Dec 9, 2024 · 1 comment
Open

compile error with gcc-15 #1421

heitbaum opened this issue Dec 9, 2024 · 1 comment

Comments

@heitbaum
Copy link

heitbaum commented Dec 9, 2024

Error occurs with 1.19.5

[1/8] Building CXX object libheif/CMakeFiles/heif.dir/file.cc.o
FAILED: libheif/CMakeFiles/heif.dir/file.cc.o
/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-g++ -DENABLE_MULTITHREADING_SUPPORT=1 -DENABLE_PARALLEL_TILE_DECODING=1 -DENABLE_PLUGIN_LOADING=1 -DHAVE_LIBDE265=1 -DHAVE_UNISTD_H -DHAVE_VISIBILITY -DHAVE_X265=1 -DIS_BIG_ENDIAN=0 -DLIBHEIF_EXPORTS -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/libheif-1.19.5/.x86_64-libreelec-linux-gnu -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/libheif-1.19.5/libheif -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/libheif-1.19.5/libheif/api -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/libheif-1.19.5/include/libheif -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/libheif-1.19.5/include -march=x86-64-v3 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -fPIC -DPIC -Wno-unused-variable -std=c++20 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden   -Werror -Wall -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Werror -MD -MT libheif/CMakeFiles/heif.dir/file.cc.o -MF libheif/CMakeFiles/heif.dir/file.cc.o.d -o libheif/CMakeFiles/heif.dir/file.cc.o -c /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/libheif-1.19.5/libheif/file.cc
In file included from /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/string:53,
                 from ../libheif/common_utils.h:26,
                 from ../libheif/box.h:25,
                 from ../libheif/file.h:24,
                 from ../libheif/file.cc:21:
In function 'constexpr void std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = unsigned char*; _Tp = unsigned char]',
    inlined from 'constexpr void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = unsigned char*; _Tp = unsigned char]' at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/bits/stl_algobase.h:989:21,
    inlined from 'constexpr _OutputIterator std::__fill_n_a(_OutputIterator, _Size, const _Tp&, random_access_iterator_tag) [with _OutputIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]' at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/bits/stl_algobase.h:1158:20,
    inlined from 'constexpr _OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]' at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/bits/stl_algobase.h:1188:29,
    inlined from 'static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]' at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/bits/stl_uninitialized.h:876:29,
    inlined from 'static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]' at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/bits/stl_uninitialized.h:868:9,
    inlined from 'constexpr _ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]' at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/bits/stl_uninitialized.h:920:20,
    inlined from 'constexpr _ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, allocator<_Tp2>&) [with _ForwardIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]' at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/bits/stl_uninitialized.h:975:44,
    inlined from 'constexpr void std::vector<_Tp, _Alloc>::_M_default_append(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]' at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/bits/vector.tcc:773:35,
    inlined from 'constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]' at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/bits/stl_vector.h:1145:21,
    inlined from 'Error HeifFile::set_item_data(const std::shared_ptr<Box_infe>&, const uint8_t*, size_t, heif_metadata_compression)' at ../libheif/file.cc:1026:22:
/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/include/c++/15.0.0/bits/stl_algobase.h:936:18: error: 'void* __builtin_memset(void*, int, long unsigned int)' offset 0 is out of the bounds [0, 0] [-Werror=array-bounds=]
  936 |         *__first = __val;
      |         ~~~~~~~~~^~~~~~~
cc1plus: all warnings being treated as errors
@fancycode
Copy link
Member

@farindk this looks similar to #1367 / #1360. Maybe a simple check for size == 0 could be added to HeifFile::set_item_data to skip processing if the input data is empty? Not sure if this fixes the compiler warning/error though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants