From e0aa61681deaa23e35bbbbcf4ec3b3d5c1b99aad Mon Sep 17 00:00:00 2001 From: claincly Date: Tue, 18 Jan 2022 15:24:25 +0000 Subject: [PATCH] Throw NPE instead of IAE when sampleMimeType is null. PiperOrigin-RevId: 422550627 --- .../android/exoplayer2/transformer/DefaultCodecFactory.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultCodecFactory.java b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultCodecFactory.java index cdfe5fa86a..8e9232e20a 100644 --- a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultCodecFactory.java +++ b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultCodecFactory.java @@ -101,14 +101,12 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; @Override public Codec createForVideoEncoding(Format format) throws TransformationException { - checkArgument(format.sampleMimeType != null); checkArgument(format.width != Format.NO_VALUE); checkArgument(format.height != Format.NO_VALUE); // According to interface Javadoc, format.rotationDegrees should be 0. The video should always // be in landscape orientation. checkArgument(format.height < format.width); checkArgument(format.rotationDegrees == 0); - // Checking again to silence null checker warning. checkNotNull(format.sampleMimeType); format = getVideoEncoderSupportedFormat(format);