sr_packet_copy: Allocate memory to copy analog data.

This commit is contained in:
Martin Ling 2015-09-05 18:03:23 +01:00 committed by Uwe Hermann
parent 2a8f2d41ad
commit 39e0113533
1 changed files with 1 additions and 0 deletions

View File

@ -1285,6 +1285,7 @@ SR_PRIV int sr_packet_copy(const struct sr_datafeed_packet *packet,
analog_copy->mq = analog->mq;
analog_copy->unit = analog->unit;
analog_copy->mqflags = analog->mqflags;
analog_copy->data = g_malloc(analog->num_samples * sizeof(float));
memcpy(analog_copy->data, analog->data,
analog->num_samples * sizeof(float));
(*copy)->payload = analog_copy;