Looks like a bug snuck in with freedv_api.c

https://github.com/drowe67/codec2/blob/master/src/freedv_api.c#L288

In order to save space on the SM1000 the f->mod_out isn't allocated.

possible solution:

#ifdef __EMBEDDED__
        /* only allocate this array for interleaver sizes > 1 to save
memory on SM1000 port */

        if (f->interleave_frames > 1) {
#endif

            f->mod_out =
(COMP*)MALLOC(sizeof(COMP)*f->interleave_frames*f->n_nat_modem_samples);
            if (f->mod_out == NULL) {
                if (f->codeword_symbols != NULL) { FREE
(f->codeword_symbols); }
                return NULL;
            }

            for (int i=0; i<f->interleave_frames*f->n_nat_modem_samples;
i++) {
                f->mod_out[i].real = 0.0;
                f->mod_out[i].imag = 0.0;
            }
#ifdef __EMBEDDED__
        }
#endif
_______________________________________________
Freetel-codec2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freetel-codec2

Reply via email to