Fix / workaround for bad track heights.
The root cause of the bad track height hasn't been tracked down yet. It may be related to collapsing tracks as it was first seen with all tracks collapsed.
This commit is contained in:
parent
97914403f6
commit
1b9e938869
|
@ -97,6 +97,10 @@ bool TrackView::HandleXMLAttribute( const wxChar *attr, const wxChar *value )
|
|||
long nValue;
|
||||
if (!wxStrcmp(attr, wxT("height")) &&
|
||||
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue)) {
|
||||
// Extreme values for track height (likely caused by integer overflow)
|
||||
// will stall Audacity as it tries to create an enormous vertical ruler.
|
||||
// So clamp to reasonable values.
|
||||
nValue = std::max( 150l, std::min( nValue, 1000l ));
|
||||
SetHeight(nValue);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue