mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Add minimum size for OpusDecoder's streamMap.
PiperOrigin-RevId: 715453498
This commit is contained in:
parent
465399b57e
commit
2b9c7f8392
@ -16,6 +16,7 @@
|
|||||||
package androidx.media3.decoder.opus;
|
package androidx.media3.decoder.opus;
|
||||||
|
|
||||||
import static androidx.annotation.VisibleForTesting.PACKAGE_PRIVATE;
|
import static androidx.annotation.VisibleForTesting.PACKAGE_PRIVATE;
|
||||||
|
import static java.lang.Math.max;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
@ -109,7 +110,7 @@ public final class OpusDecoder
|
|||||||
channelCount = getChannelCount(headerBytes);
|
channelCount = getChannelCount(headerBytes);
|
||||||
int gain = readSignedLittleEndian16(headerBytes, 16);
|
int gain = readSignedLittleEndian16(headerBytes, 16);
|
||||||
|
|
||||||
byte[] streamMap = new byte[channelCount];
|
byte[] streamMap = new byte[max(channelCount, 8)];
|
||||||
int numStreams;
|
int numStreams;
|
||||||
int numCoupled;
|
int numCoupled;
|
||||||
if (headerBytes[18] == 0) { // Channel mapping
|
if (headerBytes[18] == 0) { // Channel mapping
|
||||||
|
Loading…
x
Reference in New Issue
Block a user