Skip to content

Commit

Permalink
fix segmentation fault on temporary buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
v923z committed Jan 28, 2024
1 parent feb9ad9 commit 30c7f4f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions code/utils/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,13 @@ mp_obj_t utils_spectrogram(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw
spectrum += spectrum_sz;
}

// FIXME:
// if(scratchpad_object == mp_const_none) {
// m_del(mp_float_t, tmp, 2 * len);
// }
if(scratchpad_object == mp_const_none) {
tmp -= len;
#if ULAB_FFT_IS_NUMPY_COMPATIBLE
tmp -= len;
#endif
m_del(mp_float_t, tmp, 2 * len);
}
return MP_OBJ_FROM_PTR(out);
}

Expand Down

0 comments on commit 30c7f4f

Please sign in to comment.