fix another out of bounds situation

this time if the pitch is invalid
This commit is contained in:
tildearrow 2025-01-10 02:10:14 -05:00
parent 732383c036
commit a750157ab4

View file

@ -929,6 +929,11 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
sample->centerRate=sample->rate; sample->centerRate=sample->rate;
pitch=reader.readC(); pitch=reader.readC();
vol=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) { if (ds.version<=0x08) {
sample->rate=ymuSampleRate*400; sample->rate=ymuSampleRate*400;