Changeset 6031419


Ignore:
Timestamp:
Dec 12, 2018, 11:25:35 PM (12 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink
Children:
1ba359c, 7107ed9
Parents:
2e13788
Message:

[ci] avoid read out of bound in sink_vorbis_do_multi, simplify _open

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_vorbis.c

    r2e13788 r6031419  
    107107  float quality_mode = .9;
    108108
    109   if (s->samplerate == 0 || s->channels == 0)
    110   {
    111     AUBIO_ERR("sink_vorbis: vorbis_encode_init_vbr failed\n");
    112     return AUBIO_FAIL;
    113   }
     109  if (s->samplerate == 0 || s->channels == 0) return AUBIO_FAIL;
    114110
    115111  s->fid = fopen((const char *)s->path, "wb");
     
    248244{
    249245  uint_t c, v;
     246  uint_t channels = MIN(s->channels, write_data->height);
    250247  float **buffer = vorbis_analysis_buffer(&s->vd, (long)write);
    251248  // fill buffer
     
    256253    return;
    257254  } else {
    258     for (c = 0; c < s->channels; c++) {
     255    for (c = 0; c < channels; c++) {
    259256      for (v = 0; v < write; v++) {
    260257        buffer[c][v] = write_data->data[c][v];
Note: See TracChangeset for help on using the changeset viewer.