You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing a IsoFile from an MemoryDataSourceImpl, I always get errors like:
java.lang.RuntimeException: java.lang.IllegalArgumentException: Bad position (limit 41958): 1769172853
at java.nio.Buffer.positionImpl(Buffer.java:364)
at java.nio.Buffer.position(Buffer.java:358)
at com.googlecode.mp4parser.MemoryDataSourceImpl.positio...
This seems to be caused by map(...) implementation changing the data's position.
Restoring the position fixes the issue:
public ByteBuffer map(long startPosition, long size) throws IOException {
int oldPosition = data.position();
data.position(l2i(startPosition));
ByteBuffer result = data.slice();
result.limit(l2i(size));
data.position(oldPosition);
return result;
}
The text was updated successfully, but these errors were encountered:
When parsing a IsoFile from an MemoryDataSourceImpl, I always get errors like:
java.lang.RuntimeException: java.lang.IllegalArgumentException: Bad position (limit 41958): 1769172853
at java.nio.Buffer.positionImpl(Buffer.java:364)
at java.nio.Buffer.position(Buffer.java:358)
at com.googlecode.mp4parser.MemoryDataSourceImpl.positio...
This seems to be caused by map(...) implementation changing the data's position.
Restoring the position fixes the issue:
public ByteBuffer map(long startPosition, long size) throws IOException {
int oldPosition = data.position();
data.position(l2i(startPosition));
ByteBuffer result = data.slice();
result.limit(l2i(size));
data.position(oldPosition);
return result;
}
The text was updated successfully, but these errors were encountered: