Skip to content

Commit 1ead8f1

Browse files
committed
VideoReader fix for bytelen=1 flag in MDAT record for MP4
1 parent 61b4fc1 commit 1ead8f1

File tree

7 files changed

+7
-2
lines changed

7 files changed

+7
-2
lines changed
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20241217101652
1+
20250108230306
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20241217101652
1+
20250108230306
Binary file not shown.
Binary file not shown.

sources/net.sf.j2s.java.core/src/javajs/util/VideoReader.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ protected void readBlock(List<Map<String, Object>> contents) throws IOException
8484
int pt = this.pt;
8585
blockLen = readInt();
8686
blockType = readString(4);
87+
if (blockLen == 1) {
88+
// special flag for long length not int
89+
// presuming here it is not THAT large
90+
blockLen = (int) is.readLong();
91+
}
8792
if (verbose)
8893
System.out.println(blockType + "\t" + pt + "\t0x" + Long.toHexString(pt) + "\t" + blockLen);
8994
Map<String, Object> map = new Hashtable<>();

0 commit comments

Comments
 (0)