From: Daniel Anselmi Date: Tue, 4 Dec 2018 00:55:00 +0000 (+0100) Subject: ipdbg-la: Check if limit samples is valid (leq size of ringuffer) X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f3549a1ccf7bacdc13827e58c96912da7c631a67;p=libsigrok.git ipdbg-la: Check if limit samples is valid (leq size of ringuffer) --- diff --git a/src/hardware/ipdbg-la/api.c b/src/hardware/ipdbg-la/api.c index c24eb908..f3de8e63 100644 --- a/src/hardware/ipdbg-la/api.c +++ b/src/hardware/ipdbg-la/api.c @@ -207,7 +207,11 @@ static int config_set(uint32_t key, GVariant *data, devc->capture_ratio = g_variant_get_uint64(data); break; case SR_CONF_LIMIT_SAMPLES: - devc->limit_samples = g_variant_get_uint64(data); + { + uint64_t limit_samples = g_variant_get_uint64(data); + if (limit_samples <= devc->limit_samples_max) + devc->limit_samples = limit_samples; + } break; default: return SR_ERR_NA;