mirror of
https://github.com/opencv/opencv.git
synced 2025-06-06 00:43:52 +08:00
core(persistence): disable checks for base64 streams
This commit is contained in:
parent
f4c4b01455
commit
7d8f1dde26
@ -59,14 +59,14 @@ char* icvGets( CvFileStorage* fs, char* str, int maxCount )
|
||||
}
|
||||
str[j++] = '\0';
|
||||
fs->strbufpos = i;
|
||||
if (maxCount > 256)
|
||||
if (maxCount > 256 && !(fs->flags & cv::FileStorage::BASE64))
|
||||
CV_Assert(j < maxCount - 1 && "OpenCV persistence doesn't support very long lines");
|
||||
return j > 1 ? str : 0;
|
||||
}
|
||||
if( fs->file )
|
||||
{
|
||||
char* ptr = fgets( str, maxCount, fs->file );
|
||||
if (ptr && maxCount > 256)
|
||||
if (ptr && maxCount > 256 && !(fs->flags & cv::FileStorage::BASE64))
|
||||
{
|
||||
size_t sz = strnlen(ptr, maxCount);
|
||||
CV_Assert(sz < (size_t)(maxCount - 1) && "OpenCV persistence doesn't support very long lines");
|
||||
@ -77,7 +77,7 @@ char* icvGets( CvFileStorage* fs, char* str, int maxCount )
|
||||
if( fs->gzfile )
|
||||
{
|
||||
char* ptr = gzgets( fs->gzfile, str, maxCount );
|
||||
if (ptr && maxCount > 256)
|
||||
if (ptr && maxCount > 256 && !(fs->flags & cv::FileStorage::BASE64))
|
||||
{
|
||||
size_t sz = strnlen(ptr, maxCount);
|
||||
CV_Assert(sz < (size_t)(maxCount - 1) && "OpenCV persistence doesn't support very long lines");
|
||||
|
Loading…
Reference in New Issue
Block a user