summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--instance.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/instance.c b/instance.c
index 86b826f..b1bfd81 100644
--- a/instance.c
+++ b/instance.c
@@ -558,6 +558,10 @@ SRD_PRIV int srd_inst_decode(const struct srd_decoder_inst *di,
srd_dbg("empty buffer");
return SRD_ERR_ARG;
}
+ if (unitsize == 0) {
+ srd_dbg("unitsize 0");
+ return SRD_ERR_ARG;
+ }
((struct srd_decoder_inst *)di)->data_unitsize = unitsize;