pdfs: prevent vectors with 0 elements

...Cython arrays don't like it.
filters: prevent matrices with 0 elements

...Cython arrays don't like it.