Skip to content

Fix invalid vector indexing

There are cases where numberOfAdditionalCabacZeroBytes = 0, so a vector of size 0 is created and we can't access the first element of this vector.

This issue is highlighted when compiling with std lib assertions activated (with _GLIBCXX_ASSERTIONS=1), that leads to the following error :

/opt/gcc-13/include/c++/13.2.0/bits/stl_vector.h:1125: 
constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>; reference = unsigned char&; size_type = long unsigned int]: 
Assertion '__n < this->size()' failed.

Merge request reports

Loading