Skip to content

Commit

Permalink
fix another out of bounds situation
Browse files Browse the repository at this point in the history
this time if the pitch is invalid
  • Loading branch information
tildearrow committed Jan 10, 2025
1 parent 732383c commit a750157
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/engine/fileOps/dmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,11 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
sample->centerRate=sample->rate;
pitch=reader.readC();
vol=reader.readC();

if (pitch<0 || pitch>10) {
logW("%d: sample pitch is wrong! (%d)",i,pitch);
pitch=5;
}
}
if (ds.version<=0x08) {
sample->rate=ymuSampleRate*400;
Expand Down

0 comments on commit a750157

Please sign in to comment.