mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-03 15:43:50 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user