zeroplus: Clip sampling sizes larger that our sample memory

Otherwise, we'll return a non-sensical result for our memory_size
enumeration.
This commit is contained in:
Russ Dill 2013-12-02 21:57:46 -08:00 committed by Bert Vermeulen
parent 3e43da1f70
commit c38e64c742
1 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,9 @@ SR_PRIV int clz(unsigned int x)
SR_PRIV int set_limit_samples(struct dev_context *devc, uint64_t samples)
{
if (samples > devc->max_sample_depth)
samples = devc->max_sample_depth;
devc->limit_samples = samples;
if (samples <= 2 * 1024)