Prevent IllegalStateException in Mp4 sniffing

If a negative value is read, sniffing should just fail.

PiperOrigin-RevId: 227689568
This commit is contained in:
aquilescanta 2019-01-03 16:02:48 +00:00 committed by Oliver Woodman
parent 781ba39097
commit d30375c9a1

View File

@ -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();