diff options
author | Bert Vermeulen <bert@biot.com> | 2013-11-26 16:05:54 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2013-11-26 16:07:53 +0100 |
commit | 37b94c205e4c1c43e77e29993108f23066cbce05 (patch) | |
tree | d902c6f80bf2b2afc571fd611111f6235cf2624e /instance.c | |
parent | d95f2888014f54fc650dc575c270cc2891580f4f (diff) | |
download | libsigrokdecode-37b94c205e4c1c43e77e29993108f23066cbce05.tar.gz libsigrokdecode-37b94c205e4c1c43e77e29993108f23066cbce05.zip |
Remove 64-probe limit.
Fixes bug 120.
Diffstat (limited to 'instance.c')
-rw-r--r-- | instance.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -373,8 +373,18 @@ SRD_API struct srd_decoder_inst *srd_inst_new(struct srd_session *sess, } for (i = 0; i < di->dec_num_probes; i++) di->dec_probemap[i] = i; + di->data_unitsize = (di->dec_num_probes + 7) / 8; + /* + * Will be used to prepare a sample at every iteration + * of the instance's decode() method. + */ + if (!(di->probe_samples = g_try_malloc(di->dec_num_probes))) { + srd_err("Failed to g_malloc() sample buffer."); + g_free(di->dec_probemap); + g_free(di); + return NULL; + } } - di->data_unitsize = (di->dec_num_probes + 7) / 8; /* Create a new instance of this decoder class. */ if (!(di->py_inst = PyObject_CallObject(dec->py_dec, NULL))) { |