From: Gerhard Sittig Date: Mon, 27 Jul 2020 16:51:22 +0000 (+0200) Subject: output/srzip: improve robustness (analog-only acquisition) X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=9dde746023c99a9cd8a34ef7c4b60bad4f78f283;hp=9dde746023c99a9cd8a34ef7c4b60bad4f78f283;p=libsigrok.git output/srzip: improve robustness (analog-only acquisition) 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. ---