mirror of
https://github.com/androidx/media.git
synced 2025-05-14 11:09:53 +08:00
Prevent IllegalStateException in Mp4 sniffing
If a negative value is read, sniffing should just fail. PiperOrigin-RevId: 227689568
This commit is contained in:
parent
61a7750f23
commit
4847889a2f
@ -109,7 +109,7 @@ import java.io.IOException;
|
|||||||
headerSize = Atom.LONG_HEADER_SIZE;
|
headerSize = Atom.LONG_HEADER_SIZE;
|
||||||
input.peekFully(buffer.data, Atom.HEADER_SIZE, Atom.LONG_HEADER_SIZE - Atom.HEADER_SIZE);
|
input.peekFully(buffer.data, Atom.HEADER_SIZE, Atom.LONG_HEADER_SIZE - Atom.HEADER_SIZE);
|
||||||
buffer.setLimit(Atom.LONG_HEADER_SIZE);
|
buffer.setLimit(Atom.LONG_HEADER_SIZE);
|
||||||
atomSize = buffer.readUnsignedLongToLong();
|
atomSize = buffer.readLong();
|
||||||
} else if (atomSize == Atom.EXTENDS_TO_END_SIZE) {
|
} else if (atomSize == Atom.EXTENDS_TO_END_SIZE) {
|
||||||
// The atom extends to the end of the file.
|
// The atom extends to the end of the file.
|
||||||
long endPosition = input.getLength();
|
long endPosition = input.getLength();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user