+
+ if (!ctx->prevsample) {
+ /* Can't allocate this until we know the stream's unitsize. */
+ if (!(ctx->prevsample = g_malloc0(logic->unitsize))) {
+ g_free(ctx);
+ sr_err("%s: ctx->prevsample malloc failed", __func__);
+ return SR_ERR_MALLOC;
+ }
+ }
+