input/vcd: fix a divide by zero bug in the analog-only case
When the input data exclusively contained analog data, then creation of the submit buffer for logic data caused a division by zero. Fix the create_feed() routine.
This commit is contained in:
parent
ec30291701
commit
2cb4204c6f
|
@ -1096,9 +1096,11 @@ static void create_feeds(const struct sr_input *in)
|
||||||
inc = in->priv;
|
inc = in->priv;
|
||||||
|
|
||||||
/* Create one feed for logic data. */
|
/* Create one feed for logic data. */
|
||||||
|
if (inc->logic_count) {
|
||||||
inc->unit_size = (inc->logic_count + 7) / 8;
|
inc->unit_size = (inc->logic_count + 7) / 8;
|
||||||
inc->feed_logic = feed_queue_logic_alloc(in->sdi,
|
inc->feed_logic = feed_queue_logic_alloc(in->sdi,
|
||||||
CHUNK_SIZE / inc->unit_size, inc->unit_size);
|
CHUNK_SIZE / inc->unit_size, inc->unit_size);
|
||||||
|
}
|
||||||
|
|
||||||
/* Create one feed per analog channel. */
|
/* Create one feed per analog channel. */
|
||||||
for (l = inc->channels; l; l = l->next) {
|
for (l = inc->channels; l; l = l->next) {
|
||||||
|
|
Loading…
Reference in New Issue