Changeset 08a3e71 for src


Ignore:
Timestamp:
May 8, 2025, 6:44:39 PM (5 days ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
fix/applefworks, master
Children:
8098196
Parents:
a6a9745
Message:

[tempo] prevent oob access in beattracking (closes gh-409)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tempo/beattracking.c

    ra6a9745 r08a3e71  
    200200  for (i = 0; i < bp; i++) {
    201201    for (k = 0; k < kmax; k++) {
    202       bt->phout->data[i] += bt->dfrev->data[i + (uint_t) ROUND (bp * k)];
     202      uint_t idx = i + (uint_t) ROUND (bp * k);
     203      if (idx < bt->dfrev->length)
     204        bt->phout->data[i] += bt->dfrev->data[idx];
     205#if AUBIO_BEAT_WARNINGS
     206      else
     207        AUBIO_WRN ("[tempo] out of bounds index %d", idx);
     208#endif
    203209    }
    204210  }
Note: See TracChangeset for help on using the changeset viewer.