]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Fix divide by zero when no analog probes selected.
authorMartin Ling <redacted>
Wed, 22 Jan 2014 05:07:20 +0000 (05:07 +0000)
committerBert Vermeulen <redacted>
Thu, 23 Jan 2014 00:42:34 +0000 (01:42 +0100)
hardware/rigol-ds/api.c

index 598978e3cf4ca8a68a606a3200e5b21b89c9f995..4fc0cd17b11984bc3756315bc2a2398c450a925c 100644 (file)
@@ -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;