diff --git a/Plugins/Opus/Opus/OpusDecoder.m b/Plugins/Opus/Opus/OpusDecoder.m index 42ee99d3f..94cb769be 100644 --- a/Plugins/Opus/Opus/OpusDecoder.m +++ b/Plugins/Opus/Opus/OpusDecoder.m @@ -129,7 +129,7 @@ opus_int64 sourceTell(void *_stream) int toread = size - total; if (toread > 512) toread = 512; numread = op_read_float( opusRef, (channels < MAXCHANNELS) ? tempbuf : out, toread, NULL ); - if (numread > 0 && channels < MAXCHANNELS) { + if (numread > 0 && channels <= MAXCHANNELS) { for (int i = 0; i < numread; ++i) { for (int j = 0; j < channels; ++j) { out[i * channels + j] = tempbuf[i * channels + chmap[channels - 1][j]]; diff --git a/Plugins/Vorbis/VorbisDecoder.m b/Plugins/Vorbis/VorbisDecoder.m index 890795cbb..18ad28045 100644 --- a/Plugins/Vorbis/VorbisDecoder.m +++ b/Plugins/Vorbis/VorbisDecoder.m @@ -106,7 +106,7 @@ long sourceTell(void *datasource) float ** pcm; numread = (int)ov_read_float(&vorbisRef, &pcm, frames - total, ¤tSection); if (numread > 0) { - if (channels < MAXCHANNELS) { + if (channels <= MAXCHANNELS) { for (int i = 0; i < channels; i++) { for (int j = 0; j < numread; j++) { ((float *)buf)[(total + j) * channels + i] = pcm[chmap[channels-1][i]][j];