-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
edu.harvard.hul.ois.jhove.ModuleBase: skipBytes() might not skip all requested bytes #71
Comments
RogerMathisen
added a commit
to NationalLibraryOfNorway/jhove
that referenced
this issue
Sep 9, 2016
Sheila +1 |
+1 |
2 similar comments
+1 |
+1 |
david-russo
added a commit
to bl-dpt/jhove
that referenced
this issue
Mar 17, 2017
Broken during incorrect merge of PR openpreserve#117. Each loop of the skip method was skipping the same amount of bytes, not subtracting the amount already skipped amount. Reverted to original pull request code then refactored. Fixes openpreserve#71, fixes openpreserve#193.
david-russo
added a commit
to bl-dpt/jhove
that referenced
this issue
Mar 17, 2017
Broken during incorrect merge of PR openpreserve#117. Each loop of the skip method was skipping the same amount of bytes, not subtracting the amount already skipped. Reverted to original pull request code then refactored. Fixes openpreserve#71, fixes openpreserve#193.
This was referenced Mar 20, 2017
rgfeldman
added a commit
to rgfeldman/jhove
that referenced
this issue
Apr 10, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For large Wavefiles (>100MB) it happens that not all bytes in the DataChunk are skipped as expected in the method:
public long skipBytes(DataInputStream stream, long bytesToSkip, ModuleBase counted)
this seems to be because the call:
long n = stream.skip(bytesToSkip);
Actually might skip fewer bytes than requested (This is also stated in the Java Documentation). If this occurs it will most probably cause the parsing of the Wave file to fail, since the pointer to the next chunk will be placed inside the DATA chunk.
To avoid this problem the "long n = stream.skip(bytesToSkip);" call could be placed inside a loop that continues until all the desired bytes are skipped, or no more bytes kan be skipped (ie n=0).
The text was updated successfully, but these errors were encountered: