prevent crash (preliminary, FIXME)

This commit is contained in:
Holger Vogt 2026-07-26 11:02:47 +02:00
parent 6514fe885b
commit c481f5c21e
2 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,7 @@ typedef struct {
double PACfStop; /* input-frequency sweep stop (Hz) */
int PACpoints; /* points per decade/octave, or total for linear */
int PACstepType; /* 0 = LIN, 1 = DEC, 2 = OCT */
int PACmaxSideband; /* number of output conversion sidebands each side (0 = sb0 only) */
} PSSan;
enum {
@ -66,6 +67,7 @@ enum {
PAC_FSTOP,
PAC_POINTS,
PAC_STEPTYPE,
PAC_MAXSB,
};
#endif

View File

@ -1852,6 +1852,10 @@ SMPfindElt (SMPmatrix *eMatrix, int Row, int Col, int CreateIfMissing)
assert (IS_SPARSE (Matrix)) ;
Row = Matrix->ExtToIntRowMap [Row] ;
Col = Matrix->ExtToIntColMap [Col] ;
if (Row < 0 || Col < 0) {
fprintf(stderr, "Warning: element not found, as internal Row/Col map is not avaialable!\n");
return NULL;
}
Element = Matrix->FirstInCol [Col] ;
Element = spcFindElementInCol (Matrix, &Element, Row, Col, CreateIfMissing) ;
return (SMPelement *)Element ;