]> sigrok.org Git - libsigrok.git/blobdiff - output/text/text.c
ascii: fix for big-endian architectures.
[libsigrok.git] / output / text / text.c
index 30e04696db3534816c663e02ee080b6e7a033e4d..674fa8867e3eb492263b6131c86da5e2a4cc627d 100644 (file)
@@ -154,6 +154,12 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
                ret = SR_ERR_MALLOC;
        }
 
+       if (mode == MODE_ASCII &&
+                       !(ctx->prevsample = g_try_malloc0(num_probes / 8))) {
+               sr_err("%s: ctx->prevsample malloc failed", __func__);
+               ret = SR_ERR_MALLOC;
+       }
+
 err:
        if (ret != SR_OK) {
                g_free(ctx->header);