X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=controller.c;h=ebb9f3adb768df970da9d886b882e2df01fb950d;hp=635e47e6eae41aef5904213721eb501da50b1597;hb=3af0e3455d4263f79920afaf6aed44286ad37ba0;hpb=74bb0af5daeef0d9abcf382b238e84376b1e006b diff --git a/controller.c b/controller.c index 635e47e..ebb9f3a 100644 --- a/controller.c +++ b/controller.c @@ -305,6 +305,16 @@ SRD_API int srd_inst_option_set(struct srd_decoder_inst *di, const char *val_str; char *dbg, *key; + if (!di) { + srd_err("Invalid decoder instance."); + return SRD_ERR_ARG; + } + + if (!options) { + srd_err("Invalid options GHashTable."); + return SRD_ERR_ARG; + } + if (!PyObject_HasAttrString(di->decoder->py_dec, "options")) { /* Decoder has no options. */ if (g_hash_table_size(options) == 0) {