csv: Fix a segfault due to a g_malloc() allocating too few bytes.

This commit is contained in:
Uwe Hermann 2016-09-02 20:06:07 +02:00
parent cf1d5f1749
commit e34dbc9d08
1 changed files with 1 additions and 1 deletions

View File

@ -319,7 +319,7 @@ static void process_analog(struct context *ctx,
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.");