Skip to content

np.pad(..., mode="reflect") on an empty array goes into an infinite loop #9560

@BT123

Description

@BT123

When I test librosa library for speech recognition, I found a bug in librosa.stft and librosa.pad_center function which used numpy.pad function.

In my test, it will stick into infinite loop ,once accepted a empty list or ndarray, the numpy.pad function will stick into infinite loop.

Although the comment says that the function need a rank 1 array, but I think it still need to check the input array to avoid the above problem.

Look forward to your reply!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions