{
if( fs->strbuf )
{
- size_t i = fs->strbufpos, len = fs->strbufsize, j = 0;
+ size_t i = fs->strbufpos, len = fs->strbufsize;
+ int j = 0;
const char* instr = fs->strbuf;
while( i < len && j < maxCount-1 )
{
int xml_buf_size = 1 << 10;
char substr[] = "</opencv_storage>";
int last_occurence = -1;
- xml_buf_size = MIN(xml_buf_size, file_size);
+ xml_buf_size = MIN(xml_buf_size, int(file_size));
fseek( fs->file, -xml_buf_size, SEEK_END );
xml_buf = (char*)cvAlloc( xml_buf_size+2 );
// find the last occurence of </opencv_storage>
\r
int pixelsDrawn = rows*cols - countNonZero(img);\r
ASSERT_EQ( (3*rows + cols)*3 - 3*9, pixelsDrawn);\r
+}\r
+\r
+\r
+TEST(Core_OutputArraySreate, _1997)\r
+{\r
+ struct local {\r
+ static void create(OutputArray arr, Size submatSize, int type)\r
+ {\r
+ int sizes[] = {submatSize.width, submatSize.height};\r
+ arr.create(sizeof(sizes)/sizeof(sizes[0]), sizes, type);\r
+ }\r
+ };\r
+\r
+ Mat mat(Size(512, 512), CV_8U);\r
+ Size submatSize = Size(256, 256);\r
+\r
+ ASSERT_NO_THROW(local::create( mat(Rect(Point(), submatSize)), submatSize, mat.type() ));\r
}
\ No newline at end of file