Commit bdf23ce8 authored by Alexander Alekhin's avatar Alexander Alekhin

ts: eliminate -Warray-bounds warning

parent fafada28
...@@ -2703,7 +2703,7 @@ static void calcSobelKernel1D( int order, int _aperture_size, int size, vector<i ...@@ -2703,7 +2703,7 @@ static void calcSobelKernel1D( int order, int _aperture_size, int size, vector<i
if( _aperture_size < 0 ) if( _aperture_size < 0 )
{ {
static const int scharr[] = { 3, 10, 3, -1, 0, 1 }; static const int scharr[8] = { 3, 10, 3, -1, 0, 1, 0, 0 }; // extra elements to eliminate "-Warray-bounds" bogus warning
assert( size == 3 ); assert( size == 3 );
for( i = 0; i < size; i++ ) for( i = 0; i < size; i++ )
kernel[i] = scharr[order*3 + i]; kernel[i] = scharr[order*3 + i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment