From c892b2d460159befd195647175d6f41fdc9c87f9 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 18 Jan 2018 18:01:25 +0100 Subject: [PATCH] analysis/acan.c, check for valid startfreq an 'ac dec' or 'ac oct' can not have a startfreq <= 0 --- src/spicelib/analysis/acan.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/spicelib/analysis/acan.c b/src/spicelib/analysis/acan.c index 3a2e79a9e..1bef51747 100644 --- a/src/spicelib/analysis/acan.c +++ b/src/spicelib/analysis/acan.c @@ -82,10 +82,18 @@ ACan(CKTcircuit *ckt, int restart) switch (job->ACstepType) { case DECADE: + if (job->ACstartFreq <= 0) { + fprintf(stderr, "ERROR: AC startfreq <= 0\n"); + return E_PARMVAL; + } job->ACfreqDelta = exp(log(10.0)/job->ACnumberSteps); break; case OCTAVE: + if (job->ACstartFreq <= 0) { + fprintf(stderr, "ERROR: AC startfreq <= 0\n"); + return E_PARMVAL; + } job->ACfreqDelta = exp(log(2.0)/job->ACnumberSteps); break;