summaryrefslogtreecommitdiff
path: root/instance.c
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2013-11-26 16:05:54 +0100
committerBert Vermeulen <bert@biot.com>2013-11-26 16:07:53 +0100
commit37b94c205e4c1c43e77e29993108f23066cbce05 (patch)
treed902c6f80bf2b2afc571fd611111f6235cf2624e /instance.c
parentd95f2888014f54fc650dc575c270cc2891580f4f (diff)
downloadlibsigrokdecode-37b94c205e4c1c43e77e29993108f23066cbce05.tar.gz
libsigrokdecode-37b94c205e4c1c43e77e29993108f23066cbce05.zip
Remove 64-probe limit.
Fixes bug 120.
Diffstat (limited to 'instance.c')
-rw-r--r--instance.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/instance.c b/instance.c
index 9295963..6b8d6b4 100644
--- a/instance.c
+++ b/instance.c
@@ -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))) {