projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac33cd6
)
release filestorage before exception
author
Ilya Lavrenov
<ilya.lavrenov@itseez.com>
Tue, 1 Sep 2015 10:04:33 +0000
(13:04 +0300)
committer
Alexander Smorkalov
<alexander.smorkalov@itseez.com>
Thu, 17 Sep 2015 10:40:36 +0000
(13:40 +0300)
(cherry picked from commit
3a1bb933401446b442348026b9cb680d35f3f449
)
modules/ml/src/svm.cpp
patch
|
blob
|
history
diff --git
a/modules/ml/src/svm.cpp
b/modules/ml/src/svm.cpp
index
0a5bfff
..
594a43a
100644
(file)
--- a/
modules/ml/src/svm.cpp
+++ b/
modules/ml/src/svm.cpp
@@
-2315,7
+2315,12
@@
void CvSVM::write( CvFileStorage* fs, const char* name ) const
params.svm_type == CvSVM::ONE_CLASS ? 1 : 0;
const CvSVMDecisionFunc* df = decision_func;
if( !isSvmModelApplicable(sv_total, var_all, var_count, class_count) )
+ {
+ cvReleaseFileStorage( &fs );
+ fs = NULL;
+
CV_ERROR( CV_StsParseError, "SVM model data is invalid, check sv_count, var_* and class_count tags" );
+ }
cvStartWriteStruct( fs, name, CV_NODE_MAP, CV_TYPE_NAME_ML_SVM );