summaryrefslogtreecommitdiff
path: root/instance.c
diff options
context:
space:
mode:
Diffstat (limited to 'instance.c')
-rw-r--r--instance.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/instance.c b/instance.c
index a1de957..0e27ca3 100644
--- a/instance.c
+++ b/instance.c
@@ -1010,6 +1010,12 @@ SRD_PRIV int srd_inst_decode(struct srd_decoder_inst *di,
return SRD_ERR_ARG;
}
+ if (abs_start_samplenum != di->abs_cur_samplenum ||
+ abs_end_samplenum < abs_start_samplenum) {
+ srd_dbg("incorrect sample numbers");
+ return SRD_ERR_ARG;
+ }
+
di->data_unitsize = unitsize;
srd_dbg("Decoding: abs start sample %" PRIu64 ", abs end sample %"
@@ -1042,6 +1048,7 @@ SRD_PRIV int srd_inst_decode(struct srd_decoder_inst *di,
di->inst_id);
return SRD_ERR_PYTHON;
}
+ di->abs_cur_samplenum = abs_end_samplenum;
Py_DecRef(py_res);
} else {
/* If this is the first call, start the worker thread. */