]> sigrok.org Git - libsigrok.git/commitdiff
sr_packet_copy: Allocate memory to copy analog data.
authorMartin Ling <redacted>
Sat, 5 Sep 2015 17:03:23 +0000 (18:03 +0100)
committerUwe Hermann <redacted>
Sun, 20 Sep 2015 22:32:25 +0000 (00:32 +0200)
src/session.c

index 8211438ee28aac654804c60808c8ea6f70cd7210..113b31b75eefe974828433c32aba8dc2f36dabc3 100644 (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;