diff options
author | Eric Wong <normalperson@yhbt.net> | 2006-09-21 08:27:24 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2006-09-21 08:27:24 +0000 |
commit | 5ece12982ac9ea408b7790c91ac9363384baf750 (patch) | |
tree | 7cfe4cdbea82d5830b0d6aa91e1806348eac4a61 /src | |
parent | 64e8332fe5851a995ceee3522e63af4c701b2bf5 (diff) | |
download | mpd-5ece12982ac9ea408b7790c91ac9363384baf750.tar.gz mpd-5ece12982ac9ea408b7790c91ac9363384baf750.tar.xz mpd-5ece12982ac9ea408b7790c91ac9363384baf750.zip |
outputBuffer: avoid out-of-bounds-error in clearOutputBuffer()
I'm still not entirely certain why we index cb->metaChunkSet[]
with currentChunk (and not currentMetaChunk), but shank told me
that currentChunk is correct...
git-svn-id: https://svn.musicpd.org/mpd/trunk@4814 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/outputBuffer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c index 2b06ae529..d3a3ef464 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -41,18 +41,18 @@ void clearOutputBuffer(OutputBuffer * cb) { int currentSet = 1; - currentChunk = -1; cb->end = cb->begin; /* be sure to reset metaChunkSets cause we are skipping over audio * audio chunks, and thus skipping over metadata */ - if (sendMetaChunk == 0 && currentMetaChunk >= 0) { + if (currentChunk >= 0 && sendMetaChunk == 0 && currentMetaChunk >= 0) { currentSet = cb->metaChunkSet[currentChunk]; } clearAllMetaChunkSets(cb); - if (sendMetaChunk == 0 && currentMetaChunk >= 0) { + if (currentChunk >= 0 && sendMetaChunk == 0 && currentMetaChunk >= 0) { cb->metaChunkSet[currentChunk] = currentSet; } + currentChunk = -1; } void flushOutputBuffer(OutputBuffer * cb) |