From: Bert Vermeulen Date: Fri, 20 Jun 2014 15:01:48 +0000 (+0200) Subject: Check srd_decoder_get_by_id() output. X-Git-Tag: sigrok-cli-0.6.0~98 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3a8ceb6ab20eda808a31d0d5e81483ced0ab18bf;p=sigrok-cli.git Check srd_decoder_get_by_id() output. This fixes bug 370. Thanks to Sander Alberink for the bug report and patch. --- diff --git a/decode.c b/decode.c index add16f7..830882d 100644 --- a/decode.c +++ b/decode.c @@ -142,7 +142,11 @@ int register_pds(const char *opt_pds, char *opt_pd_annotations) ret = 1; break; } - dec = srd_decoder_get_by_id(pd_name); + if (!(dec = srd_decoder_get_by_id(pd_name))) { + g_critical("Failed to get decoder %s by id.", pd_name); + ret = 1; + break; + } /* Convert decoder option and channel values to GVariant. */ if (!opts_to_gvar(dec, pd_opthash, &options)) {