fix possible hang when loading invalid MA/Ox feat
in instrument issue #2021
This commit is contained in:
parent
6288e18a7a
commit
d769264e25
|
@ -1490,6 +1490,12 @@ void DivInstrument::readFeatureMA(SafeReader& reader, short version) {
|
|||
|
||||
unsigned short macroHeaderLen=reader.readS();
|
||||
|
||||
if (macroHeaderLen==0) {
|
||||
logW("invalid macro header length!");
|
||||
READ_FEAT_END;
|
||||
return;
|
||||
}
|
||||
|
||||
DivInstrumentMacro* target=&std.volMacro;
|
||||
|
||||
while (reader.tell()<endOfFeat) {
|
||||
|
@ -1716,6 +1722,12 @@ void DivInstrument::readFeatureOx(SafeReader& reader, int op, short version) {
|
|||
|
||||
unsigned short macroHeaderLen=reader.readS();
|
||||
|
||||
if (macroHeaderLen==0) {
|
||||
logW("invalid macro header length!");
|
||||
READ_FEAT_END;
|
||||
return;
|
||||
}
|
||||
|
||||
DivInstrumentMacro* target=&std.opMacros[op].amMacro;
|
||||
|
||||
while (reader.tell()<endOfFeat) {
|
||||
|
|
Loading…
Reference in a new issue