mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-29 06:10:34 +05:00
check for num=0 before memcpy
This commit is contained in:
parent
22797971f6
commit
a86d231714
@ -109,6 +109,7 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
void * p = new char [(line.maxsize+5) * elsize];
|
void * p = new char [(line.maxsize+5) * elsize];
|
||||||
|
|
||||||
|
if (line.maxsize*elsize)
|
||||||
memcpy (p, line.col, line.maxsize * elsize);
|
memcpy (p, line.col, line.maxsize * elsize);
|
||||||
delete [] (char*)line.col;
|
delete [] (char*)line.col;
|
||||||
|
|
||||||
|
@ -49,7 +49,8 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
data = NULL; height = width = 0;
|
data = NULL; height = width = 0;
|
||||||
SetSize (m2.Height(), m2.Width());
|
SetSize (m2.Height(), m2.Width());
|
||||||
memcpy (data, m2.data, sizeof(double) * Height() * Width());
|
if (Height()*Width())
|
||||||
|
memcpy (data, m2.data, sizeof(double) * (Height() * Width()));
|
||||||
}
|
}
|
||||||
|
|
||||||
DenseMatrix :: ~DenseMatrix ()
|
DenseMatrix :: ~DenseMatrix ()
|
||||||
|
Loading…
Reference in New Issue
Block a user