mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
Fixed out of bound reading in makeAgastOffsets
This commit is contained in:
parent
41d55c5095
commit
ee5b5a6b2f
@ -82,10 +82,15 @@ void makeAgastOffsets(int pixel[16], int rowStride, int type)
|
||||
type == AgastFeatureDetector::AGAST_7_12s ? offsets12s :
|
||||
type == AgastFeatureDetector::AGAST_5_8 ? offsets8 : 0;
|
||||
|
||||
const int offsets_len = type == AgastFeatureDetector::OAST_9_16 ? 16 :
|
||||
type == AgastFeatureDetector::AGAST_7_12d ? 12 :
|
||||
type == AgastFeatureDetector::AGAST_7_12s ? 12 :
|
||||
type == AgastFeatureDetector::AGAST_5_8 ? 8 : 0;
|
||||
|
||||
CV_Assert(pixel && offsets);
|
||||
|
||||
int k = 0;
|
||||
for( ; k < 16; k++ )
|
||||
for( ; k < offsets_len; k++ )
|
||||
pixel[k] = offsets[k][0] + offsets[k][1] * rowStride;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user