Skip to content
Snippets Groups Projects
Commit 5aca292f authored by Vojtech Moravec's avatar Vojtech Moravec
Browse files

Read magic value outside of assert.

parent 0e3bea74
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,11 @@ public class QCMPFileHeader {
}
byte[] magicBuffer = new byte[QCMP_MAGIC_VALUE.length()];
assert (inputStream.readNBytes(magicBuffer, 0, QCMP_MAGIC_VALUE.length()) == QCMP_MAGIC_VALUE.length());
final int readFromMagic = inputStream.readNBytes(magicBuffer, 0, QCMP_MAGIC_VALUE.length());
if (readFromMagic != QCMP_MAGIC_VALUE.length()) {
// Invalid magic value.
return false;
}
magicValue = new String(magicBuffer);
if (!magicValue.equals(QCMP_MAGIC_VALUE)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment