From: Martin Ling Date: Wed, 22 Jan 2014 05:07:20 +0000 (+0000) Subject: rigol-ds: Fix divide by zero when no analog probes selected. X-Git-Tag: libsigrok-0.3.0~199 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=824eb2acfd1a9047f4044370c6375a79d7e2c7b2;p=libsigrok.git rigol-ds: Fix divide by zero when no analog probes selected. --- diff --git a/hardware/rigol-ds/api.c b/hardware/rigol-ds/api.c index 598978e3..4fc0cd17 100644 --- a/hardware/rigol-ds/api.c +++ b/hardware/rigol-ds/api.c @@ -515,6 +515,9 @@ static int analog_frame_size(const struct sr_dev_inst *sdi) analog_probes++; } + if (analog_probes == 0) + return 0; + switch (devc->data_source) { case DATA_SOURCE_LIVE: return devc->model->series->live_samples;