Skip to content

genesys: GL845 has vector size 257 as well

Zdenek Dohnal requested to merge zdohnal/backends:genesys_gl845_crash into master

Hi,

we have a report in Fedora, where user has Plustek 8200i and scanning crashes for him.

It happens because the variable size (=257) which is used for iterating is greater than number of elements (=256) in the vector rgamma - when the backend tries to access the index 256 (which is element 257, since C/C++ arrays are indexed from 0), it crashes.

The reason why the number of elements of rgamma is 256 is due the vector is created in sanei_genesys_create_default_gamma_table() and the asic type of Plustek 8200i is GL845, which is not among the types which set number of elements to 257.

Adding GL845 into types which creates a bigger vector fixes the issue - user tested it in his environment and scanning works fine for him afterwards.

Would you mind merging the patch to the project?

Thank you in advance!

Zdenek

Merge request reports