static const char_t *aubio_get_extension(const char_t *filename)
{
+ if (!filename) return NULL;
// find last occurence of dot character
const char_t *ext = strrchr(filename, '.');
if (!ext || ext == filename) return "";
#ifdef HAVE_VORBISENC
// check if this uri could be for us
uint_t match_oggstream = 0;
- if (strcmp (uri_ext, "ogg") == 0) match_oggstream = 1;
+ if (uri_ext && strcmp (uri_ext, "ogg") == 0) match_oggstream = 1;
if (match_oggstream) {
s->sink = (void *)new_aubio_sink_vorbis(uri, samplerate);
if (s->sink) {
#ifdef HAVE_FLAC
// check if this uri could be for us
uint_t match_flacstream = 0;
- if (strcmp (uri_ext, "flac") == 0) match_flacstream = 1;
+ if (uri_ext && strcmp (uri_ext, "flac") == 0) match_flacstream = 1;
if (match_flacstream) {
s->sink = (void *)new_aubio_sink_flac(uri, samplerate);
if (s->sink) {