Commit c57484f9 by Andrey Udovenko

Fix for IV bigger than 32 bits #145

parent 3abcefa0
...@@ -393,11 +393,8 @@ public class HlsChunkSource { ...@@ -393,11 +393,8 @@ public class HlsChunkSource {
byte[] secretKey = new byte[data.bytesLeft()]; byte[] secretKey = new byte[data.bytesLeft()];
data.readBytes(secretKey, 0, secretKey.length); data.readBytes(secretKey, 0, secretKey.length);
int ivParsed = Integer.parseInt(iv, 16);
String iv = String.format("%032X", ivParsed);
byte[] ivData = new BigInteger(iv, 16).toByteArray(); byte[] ivData = new BigInteger(iv, 16).toByteArray();
byte[] ivDataWithPadding = new byte[iv.length() / 2]; byte[] ivDataWithPadding = new byte[16];
System.arraycopy(ivData, 0, ivDataWithPadding, ivDataWithPadding.length - ivData.length, System.arraycopy(ivData, 0, ivDataWithPadding, ivDataWithPadding.length - ivData.length,
ivData.length); ivData.length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment