Changeset 4b16721


Ignore:
Timestamp:
Dec 21, 2018, 5:16:18 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
Children:
4b266f1
Parents:
519d5d3
Message:

[source_sndfile] set error message when reading after close

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_sndfile.c

    r519d5d3 r4b16721  
    175175  sf_count_t read_samples = aubio_sf_read_smpl (s->handle, s->scratch_data,
    176176      s->scratch_size);
     177  if (!s->handle) {
     178    AUBIO_ERR("source_sndfile: could not read from %s (file was closed)\n",
     179        s->path);
     180    *read = 0;
     181    return;
     182  }
    177183
    178184  uint_t read_length = read_samples / s->input_channels;
     
    220226  sf_count_t read_samples = aubio_sf_read_smpl (s->handle, s->scratch_data,
    221227      s->scratch_size);
     228  if (!s->handle) {
     229    AUBIO_ERR("source_sndfile: could not read from %s (file was closed)\n",
     230        s->path);
     231    *read = 0;
     232    return;
     233  }
    222234
    223235  uint_t read_length = read_samples / s->input_channels;
Note: See TracChangeset for help on using the changeset viewer.