]> sigrok.org Git - libsigrok.git/commitdiff
output/srzip: improve robustness (analog-only acquisition)
authorGerhard Sittig <redacted>
Mon, 27 Jul 2020 16:51:22 +0000 (18:51 +0200)
committerGerhard Sittig <redacted>
Mon, 27 Jul 2020 17:45:46 +0000 (19:45 +0200)
For pure analog acquisition without logic data the ZIP creation code
path resulted in a division by zero. Skip the bytes to samples math in
that case. How to reproduce:

  $ sigrok-cli -d demo:logic_channels=0:analog_channels=1 --samples 20 -o file.sr

Avoid a dependency on malloc(0) behaviour while we are here. Add a
warning on data feed submitter implementation issues, to not silently
drop the data, which could surprise users. This ShouldNotHappen(TM) for
correct implementations where channel counts and unit size agree, but
was observed with incomplete out-of-tree implementations. Eliminate
a data type redundancy in another malloc() call.


No differences found