openbsd-ports/audio/audacity/patches/patch-src_Sequence_cpp
2009-03-14 03:49:43 +00:00

30 lines
1.0 KiB
Plaintext

$OpenBSD: patch-src_Sequence_cpp,v 1.5 2009/03/14 03:49:43 jakemsr Exp $
--- src/Sequence.cpp.orig Tue Jan 27 12:50:58 2009
+++ src/Sequence.cpp Tue Feb 10 03:21:35 2009
@@ -952,7 +952,8 @@ bool Sequence::Get(samplePtr buffer, sampleFormat form
sampleCount start, sampleCount len) const
{
if (start < 0 || start > mNumSamples ||
- start+len > mNumSamples)
+ start+len > mNumSamples ||
+ (format != mSampleFormat) || !buffer)
return false;
int b = FindBlock(start);
@@ -986,6 +987,7 @@ bool Sequence::Set(samplePtr buffer, sampleFormat form
if (format != mSampleFormat) {
temp = NewSamples(mMaxSamples, mSampleFormat);
wxASSERT(temp);
+ return false;
}
samplePtr silence = NULL;
@@ -993,6 +995,7 @@ bool Sequence::Set(samplePtr buffer, sampleFormat form
silence = NewSamples(mMaxSamples, format);
wxASSERT(silence);
ClearSamples(silence, format, 0, mMaxSamples);
+ return false;
}
int b = FindBlock(start);