sr_info("Set sample period to %" PRIu64 " %s",
ctx->period, ctx->xlabel);
}
- ctx->title = o->sdi->driver->longname;
+ ctx->title = (o->sdi && o->sdi->driver) ? o->sdi->driver->longname : "unknown";
/* Some metadata */
if (ctx->header && !ctx->did_header) {
num_channels = g_slist_length(meaning->channels);
ctx->channels_seen += num_channels;
sr_dbg("Processing packet of %u analog channels", num_channels);
- fdata = g_malloc(analog->num_samples * num_channels);
+ fdata = g_malloc(analog->num_samples * num_channels * sizeof(float));
if ((ret = sr_analog_to_float(analog, fdata)) != SR_OK)
sr_warn("Problems converting data to floating point values.");