diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2015-09-10 18:19:47 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2015-09-10 20:03:25 +0200 |
commit | 2730fe2397101f2c0a66abd3a7fd5fa531d3c710 (patch) | |
tree | 5f72bee8993e5ce878889d1d6cd693c3e229ef16 /instance.c | |
parent | 9576e005e18b2d0131e0fce5279a401cbe71c0f8 (diff) | |
download | libsigrokdecode-2730fe2397101f2c0a66abd3a7fd5fa531d3c710.tar.gz libsigrokdecode-2730fe2397101f2c0a66abd3a7fd5fa531d3c710.zip |
instance.c: Don't use 'di' before NULL-checking it.
Diffstat (limited to 'instance.c')
-rw-r--r-- | instance.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -546,14 +546,6 @@ SRD_PRIV int srd_inst_decode(const struct srd_decoder_inst *di, PyObject *py_res; srd_logic *logic; - ((struct srd_decoder_inst *)di)->data_unitsize = unitsize; - - srd_dbg("Calling decode(), start sample %" PRIu64 ", end sample %" - PRIu64 " (%" PRIu64 " samples, %" PRIu64 " bytes, unitsize = " - "%d), instance %s.", start_samplenum, end_samplenum, - end_samplenum - start_samplenum, inbuflen, di->data_unitsize, - di->inst_id); - /* Return an error upon unusable input. */ if (!di) { srd_dbg("empty decoder instance"); @@ -568,6 +560,14 @@ SRD_PRIV int srd_inst_decode(const struct srd_decoder_inst *di, return SRD_ERR_ARG; } + ((struct srd_decoder_inst *)di)->data_unitsize = unitsize; + + srd_dbg("Calling decode(), start sample %" PRIu64 ", end sample %" + PRIu64 " (%" PRIu64 " samples, %" PRIu64 " bytes, unitsize = " + "%d), instance %s.", start_samplenum, end_samplenum, + end_samplenum - start_samplenum, inbuflen, di->data_unitsize, + di->inst_id); + /* * Create new srd_logic object. Each iteration around the PD's loop * will fill one sample into this object. |