Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev

This commit is contained in:
Frederik Gladhorn
2013-08-13 21:00:22 +02:00
committed by The Qt Project
11 changed files with 390 additions and 17 deletions

View File

@@ -244,16 +244,18 @@ bool QWaveDecoder::enoughDataAvailable()
bool QWaveDecoder::findChunk(const char *chunkId)
{
chunk descriptor;
if (!peekChunk(&descriptor))
return false;
if (qstrncmp(descriptor.id, chunkId, 4) == 0)
return true;
do {
if (!peekChunk(&descriptor))
return false;
if (qstrncmp(descriptor.id, chunkId, 4) == 0)
return true;
// It's possible that bytes->available() is less than the chunk size
// if it's corrupt.
junkToSkip = qint64(sizeof(chunk) + descriptor.size);
// It's possible that bytes->available() is less than the chunk size
// if it's corrupt.
junkToSkip = qint64(sizeof(chunk) + descriptor.size);
while (source->bytesAvailable() > 0) {
// Skip the current amount
if (junkToSkip > 0)
discardBytes(junkToSkip);
@@ -263,12 +265,7 @@ bool QWaveDecoder::findChunk(const char *chunkId)
if (junkToSkip > 0)
return false;
if (!peekChunk(&descriptor))
return false;
if (qstrncmp(descriptor.id, chunkId, 4) == 0)
return true;
}
} while (source->bytesAvailable() > 0);
return false;
}