SIFT::operator() crash for matrices with 1 row or column (Bug #2460)


Added by Josh Klontz over 12 years ago. Updated over 9 years ago.


Status:Open Start date:2012-10-19
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:nonfree
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

There's an edge case whereby if an image is passed in with just 1 row or column then the computation of:
// line 699 of SIFT.cpp in the 2.4.2 release
int nOctaves = cvRound(log( (double)std::min( base.cols, base.rows ) ) / log(2.) - 2); // nOctaves = -2

causes a nasty crash here:
// line 199 of SIFT.cpp in the 2.4.2 release
pyr.resize(nOctaves*(nOctaveLayers + 3));

as std::vector::resize is called with a value of -2.


Associated revisions

Revision a489d86e
Added by Roman Donchenko almost 11 years ago

Merge pull request #2460 from berak:b_3598_24

History

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4439

Also available in: Atom PDF