biod.pnpi.spb.ru
/
alexxy
/
gromacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e230816
)
Remove segv in xpm2ps, fixes #611
author
Carsten Kutzner
<ckutzne@gwdg.de>
Fri, 26 Aug 2011 14:05:41 +0000
(16:05 +0200)
committer
Carsten Kutzner
<ckutzne@gwdg.de>
Wed, 31 Aug 2011 08:03:50 +0000
(10:03 +0200)
Issue a fatal error if matrix elements are to be
added/subtracted/multiplied/divided (with xpm2ps -compine) but no
proper matrix data could be extracted from one of the xpm files.
src/tools/gmx_xpm2ps.c
patch
|
blob
|
history
diff --git
a/src/tools/gmx_xpm2ps.c
b/src/tools/gmx_xpm2ps.c
index fb057f4a3335f83fd191010933074f3d9ce36b27..317a736c5edd9b5e5e33ee029784d901bad2b53e 100644
(file)
--- a/
src/tools/gmx_xpm2ps.c
+++ b/
src/tools/gmx_xpm2ps.c
@@
-941,6
+941,12
@@
void write_combined_matrix(int ecombine, const char *fn,
printf("Combining two %dx%d matrices\n",mat1[k].nx,mat1[k].ny);
rmat1 = matrix2real(&mat1[k], NULL);
rmat2 = matrix2real(&mat2[k], NULL);
+ if (NULL == rmat1 || NULL == rmat2)
+ {
+ gmx_fatal(FARGS, "Could not extract real data from %s xpm matrices. Note that, e.g.,\n"
+ "g_rms and g_mdmat provide such data, but not do_dssp.\n",
+ (NULL==rmat1 && NULL==rmat2) ? "both" : "one of the" );
+ }
rlo=1e38;
rhi=-1e38;
for(j=0; j<mat1[k].ny; j++)