diff --git a/libraries/decoder_opus/src/main/java/androidx/media3/decoder/opus/OpusDecoder.java b/libraries/decoder_opus/src/main/java/androidx/media3/decoder/opus/OpusDecoder.java index d5637ff201..99b1424082 100644 --- a/libraries/decoder_opus/src/main/java/androidx/media3/decoder/opus/OpusDecoder.java +++ b/libraries/decoder_opus/src/main/java/androidx/media3/decoder/opus/OpusDecoder.java @@ -107,12 +107,10 @@ public final class OpusDecoder throw new OpusDecoderException("Invalid header length"); } channelCount = getChannelCount(headerBytes); - if (channelCount > 8) { - throw new OpusDecoderException("Invalid channel count: " + channelCount); - } + int gain = readSignedLittleEndian16(headerBytes, 16); - byte[] streamMap = new byte[8]; + byte[] streamMap = new byte[channelCount]; int numStreams; int numCoupled; if (headerBytes[18] == 0) { // Channel mapping