From 4847889a2f200cc7070cf51fb10fe52ffea57fcb Mon Sep 17 00:00:00 2001 From: aquilescanta Date: Thu, 3 Jan 2019 16:02:48 +0000 Subject: [PATCH] Prevent IllegalStateException in Mp4 sniffing If a negative value is read, sniffing should just fail. PiperOrigin-RevId: 227689568 --- .../com/google/android/exoplayer2/extractor/mp4/Sniffer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/Sniffer.java b/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/Sniffer.java index dce00fa824..657a955ab4 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/Sniffer.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/Sniffer.java @@ -109,7 +109,7 @@ import java.io.IOException; headerSize = Atom.LONG_HEADER_SIZE; input.peekFully(buffer.data, Atom.HEADER_SIZE, Atom.LONG_HEADER_SIZE - Atom.HEADER_SIZE); buffer.setLimit(Atom.LONG_HEADER_SIZE); - atomSize = buffer.readUnsignedLongToLong(); + atomSize = buffer.readLong(); } else if (atomSize == Atom.EXTENDS_TO_END_SIZE) { // The atom extends to the end of the file. long endPosition = input.getLength();