From 5d503fc5d3bba265bdbed51e2e66df8793228ea1 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 26 Sep 2019 16:29:23 +0200 Subject: [PATCH] textual --- client/graph.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/graph.c b/client/graph.c index 7031da5e2..05d6a33dd 100644 --- a/client/graph.c +++ b/client/graph.c @@ -84,6 +84,8 @@ void setGraphBuf(uint8_t *buff, size_t size) { size_t getFromGraphBuf(uint8_t *buff) { if (buff == NULL) return 0; + if (GraphTraceLen == 0) return 0; + size_t i; for (i = 0; i < GraphTraceLen; ++i) { //trim @@ -134,6 +136,11 @@ void convertGraphFromBitstreamEx(int hi, int low) { } size_t size = getFromGraphBuf(bits); + if (size == 0) { + PrintAndLogEx(WARNING, "Failed to copy from graphbuffer"); + free(bits); + return -1; + } // set signal properties low/high/mean/amplitude and is_noise detection computeSignalProperties(bits, size);