Skip to content

Fix abort in genesys backend during sending slope table

Zdenek Dohnal requested to merge zdohnal/backends:genesys-lide60-abrt into master

Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=1807751

Hi,

we got the bug mentioned above - the user has Canon Lide 60, which is crashing during scanning:

scanimage -d <device> --format=png -o scan.png
/usr/include/c++/9/bits/stl_vector.h:1060: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = short unsigned int; _Alloc = std::allocator<short unsigned int>; std::vector<_Tp, _Alloc>::const_reference = const short unsigned int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
Aborted (core dumped)

Backtrace The backend is going through vector of size 255 (0-254), iterating over steps variable with value 256. It crashes when the loop is trying to access the element 255, which does not exists.

The fix is to create vector of 256 size for asic type GL841. Would you mind adding it to the project? The user confirmed it worked.

Merge request reports