From 7fb694756b1cec8fb065851472cb6a6ee79effe7 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Wed, 4 Apr 2012 13:25:37 +0000 Subject: [PATCH] Fixed bug in reading zero-size Mat from FileStorage --- modules/core/src/persistence.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/core/src/persistence.cpp b/modules/core/src/persistence.cpp index d73e911..c8c3664 100644 --- a/modules/core/src/persistence.cpp +++ b/modules/core/src/persistence.cpp @@ -3457,6 +3457,8 @@ icvReadMat( CvFileStorage* fs, CvFileNode* node ) mat = cvCreateMat( rows, cols, elem_type ); cvReadRawData( fs, data, mat->data.ptr, dt ); } + else if( rows == 0 && cols == 0 ) + mat = cvCreateMatHeader( 0, 1, elem_type ); else mat = cvCreateMatHeader( rows, cols, elem_type ); -- 2.7.4