google / butteraugli

butteraugli estimates the psychovisual difference between two images
Apache License 2.0
1.96k stars 137 forks source link

Make{Low, High}FreqColorDiff{Dx, Dy}() functions incorrectly initialize the lut array #29

Open DominikWitczakAMD opened 7 years ago

DominikWitczakAMD commented 7 years ago

The three functions declare the lut table using std::array<>, but do not assign 0 to the zeroth element of the array. I'm not a C++11 spec expert but under Visual Studio 2017 this leads to guard values /trash being assigned to lut[0]. This has a nasty effect on mask computations, as it now gets filled with INF values which ultimately leads to a division by zero exception.