From 57f8bc10ebd5b0e39761f1098a38e40814db5e8b Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 29 Jan 2019 03:31:38 +0100 Subject: [PATCH] [tensor] add warning in aubio_tensor_as_fmat, to be avoided --- src/ai/tensor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ai/tensor.c b/src/ai/tensor.c index 976706a0..a15818e9 100644 --- a/src/ai/tensor.c +++ b/src/ai/tensor.c @@ -93,6 +93,8 @@ uint_t aubio_tensor_as_fmat(aubio_tensor_t *c, fmat_t *o) { o->height = c->shape[0]; o->length = c->size / c->shape[0]; o->data = c->data; + // o was allocated on the stack, data[1] may be NULL + AUBIO_WRN("aubio_tensor_as_fmat will not create a usable table of rows\n"); return AUBIO_OK; } -- 2.11.0