Skip to content

A mismatch of buffer types I and O and IOSpec is not checked for #5

@teodly

Description

@teodly

Note that I'm a beginner to Rust so I may be wrong.

The Soxr::process function doesn't require that arguments contain references to slices containing the same data type that was specified in IOSpec::new. It means that libsoxr may accidentally read or write beyond allocated memory if it was created with IOSpec specifying 64-bit float and a 32-bit float slice is given as an argument.

Also, it doesn't support split (planar) channels while original libsoxr does. The problem is that it gets input and output lengths for libsoxr from input & output slices lengths. It won't work if the arguments contain references to slices of references to slices (similarly to libsoxr API which excepts array of arrays) because the outer slice's length is in such case the number of channels, not number of samples.

Both issues could be solved (if I think correctly) by making the whole Soxr type generic over input and output types and removing IOSpec argument from the constructor.

I won't be able to propose a pull request myself because I don't know Rust well enough and implementing it requires fluency in generic programming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions