Commit 3e48b547 authored by Jussi Lindgren's avatar Jussi Lindgren

Plugins: Fixed Matlab box crash with Streamed Matrix outputs

parent 0da11763
...@@ -17,9 +17,7 @@ function [errno, nb_dimensions, dimension_sizes, dimension_labels] = OV_getStrea ...@@ -17,9 +17,7 @@ function [errno, nb_dimensions, dimension_sizes, dimension_labels] = OV_getStrea
else else
nb_dimensions = box_in.outputs{output_index}.header.nb_dimensions; nb_dimensions = box_in.outputs{output_index}.header.nb_dimensions;
dimension_sizes = box_in.outputs{output_index}.header.dimension_sizes; dimension_sizes = box_in.outputs{output_index}.header.dimension_sizes;
% we produce a 1 dimension array (linear array of labels. it's easier dimension_labels = box_in.outputs{output_index}.header.dimension_labels;
% to process in the C++ code.
dimension_labels = horzcat(box_in.outputs{output_index}.header.dimension_labels{1:end});
errno = 0; errno = 0;
end end
......
...@@ -317,7 +317,7 @@ boolean CMatlabHelper::getStreamedMatrixOutputHeader(uint32 ui32OutputIndex, IMa ...@@ -317,7 +317,7 @@ boolean CMatlabHelper::getStreamedMatrixOutputHeader(uint32 ui32OutputIndex, IMa
for(uint32 i = 0; i<l_ui32NbDimensions;i++) for(uint32 i = 0; i<l_ui32NbDimensions;i++)
{ {
pMatrix->setDimensionSize(i,(uint32) mxGetPr(l_pDimensionSizes)[i]); pMatrix->setDimensionSize(i,(uint32) mxGetPr(l_pDimensionSizes)[i]);
for(uint32 x = 0; x<pMatrix->getDimensionSize(i); x++) for(uint32 x = 0; x<pMatrix->getDimensionSize(i) && l_ui32Index < l_oNbCells ; x++)
{ {
CString l_sNameTmp = l_pNameList[l_ui32Index]; CString l_sNameTmp = l_pNameList[l_ui32Index];
pMatrix->setDimensionLabel(i,x,escapeMatlabString(l_sNameTmp)); pMatrix->setDimensionLabel(i,x,escapeMatlabString(l_sNameTmp));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment