1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-06 22:45:29 +01:00

Fix infinite loop of error messages trying to draw corrupt project...

... As reported by Steve.

Don't throw exceptions when trying only to display a track and the samples
can't be found in the database.
This commit is contained in:
Paul Licameli
2020-08-26 21:39:57 -04:00
parent 2389b191f6
commit 70175acaf4
2 changed files with 13 additions and 2 deletions

View File

@@ -385,12 +385,21 @@ bool SqliteSampleBlock::GetSummary(float *dest,
sqlite3_stmt *stmt,
size_t srcbytes)
{
return GetBlob(dest,
// Non-throwing, it returns true for success
try {
// Note GetBlob returns a size_t, not a bool
GetBlob(dest,
floatSample,
stmt,
floatSample,
frameoffset * 3 * SAMPLE_SIZE(floatSample),
numframes * 3 * SAMPLE_SIZE(floatSample)) / 3 / SAMPLE_SIZE(floatSample);
numframes * 3 * SAMPLE_SIZE(floatSample));
return true;
}
catch ( const AudacityException & ) {
memset(dest, 0, 3 * numframes * sizeof( float ));
return false;
}
}
double SqliteSampleBlock::GetSumMin() const