Skip to content

Commit

Permalink
Fixing potential segfault referencing cuda_cascade
Browse files Browse the repository at this point in the history
This resolves a potential segfault encounted at line 76 where cuda_cascade is an invalid value.
  • Loading branch information
alandtse authored Feb 1, 2018
1 parent 99ebc69 commit 36231bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/openalpr/detection/detectorcuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ namespace alpr
#if OPENCV_MAJOR_VERSION == 2
if( this->cuda_cascade.load( get_detector_file() ) )
#else
if( this->cuda_cascade->create( get_detector_file() ) )
cuda_cascade = cuda::CascadeClassifier::create(get_detector_file());
if( !this->cuda_cascade.get()->empty() )
#endif
{
this->loaded = true;
Expand Down

0 comments on commit 36231bb

Please sign in to comment.