1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

core: added checks and "fixit" items for persistence parsers

To raise errors with proper messages of the problems.
This commit is contained in:
Alexander Alekhin
2018-03-14 14:03:46 +03:00
parent 7ee217285b
commit f4c4b01455
5 changed files with 58 additions and 18 deletions
+2 -1
View File
@@ -51,7 +51,7 @@ static char* icvYMLSkipSpaces( CvFileStorage* fs, char* ptr, int min_indent, int
CV_PARSE_ERROR( "Too long string or a last string w/o newline" );
}
fs->lineno++;
fs->lineno++; // FIXIT doesn't really work with long lines. It must be counted via '\n' or '\r' symbols, not the number of icvGets() calls.
}
else
CV_PARSE_ERROR( *ptr == '\t' ? "Tabs are prohibited in YAML!" : "Invalid character" );
@@ -331,6 +331,7 @@ force_int:
CV_PARSE_ERROR( "Invalid numeric value (inconsistent explicit type specification?)" );
ptr = endptr;
CV_PERSISTENCE_CHECK_END_OF_BUFFER_BUG();
}
else if( c == '\'' || c == '\"' ) // an explicit string
{