Skip to content

Commit

Permalink
Fix crashes and hangs on importing some Hydrogen drum kit songs (#5420)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhysSong authored Mar 23, 2020
1 parent d382d4e commit 2367a62
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plugins/HydrogenImport/HydrogenImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,19 @@ bool HydrogenImport::readSong()
else
{
unsigned nLayer = 0;
QDomNode layerNode = instrumentNode.firstChildElement( "layer" );
QDomNode instrumentComponentNode = instrumentNode.firstChildElement("instrumentComponent");
if (instrumentComponentNode.isNull())
{
instrumentComponentNode = instrumentNode;
}

QDomNode layerNode = instrumentComponentNode.firstChildElement( "layer" );
while ( ! layerNode.isNull() )
{
if ( nLayer >= MAX_LAYERS )
{
printf( "nLayer >= MAX_LAYERS" );
continue;
printf("nLayer >= MAX_LAYERS\n");
break;
}
QString sFilename = LocalFileMng::readXmlString( layerNode, "filename", "" );
QString sMode = LocalFileMng::readXmlString( layerNode, "smode", "forward" );
Expand Down

0 comments on commit 2367a62

Please sign in to comment.