Changeset d286fe4 for src


Ignore:
Timestamp:
Dec 17, 2018, 11:00:02 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/crepe, fix/ffmpeg5, master
Children:
20ce2ad
Parents:
d013a93
Message:

[io] prevent crash in sink on null path

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink.c

    rd013a93 rd286fe4  
    9494static const char_t *aubio_get_extension(const char_t *filename)
    9595{
     96  if (!filename) return NULL;
    9697  // find last occurence of dot character
    9798  const char_t *ext = strrchr(filename, '.');
     
    109110  // check if this uri could be for us
    110111  uint_t match_oggstream = 0;
    111   if (strcmp (uri_ext, "ogg") == 0) match_oggstream = 1;
     112  if (uri_ext && strcmp (uri_ext, "ogg") == 0) match_oggstream = 1;
    112113  if (match_oggstream) {
    113114    s->sink = (void *)new_aubio_sink_vorbis(uri, samplerate);
     
    129130  // check if this uri could be for us
    130131  uint_t match_flacstream = 0;
    131   if (strcmp (uri_ext, "flac") == 0) match_flacstream = 1;
     132  if (uri_ext && strcmp (uri_ext, "flac") == 0) match_flacstream = 1;
    132133  if (match_flacstream) {
    133134    s->sink = (void *)new_aubio_sink_flac(uri, samplerate);
Note: See TracChangeset for help on using the changeset viewer.