mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix for IV bigger than 32 bits #145
This commit is contained in:
parent
3abcefa00c
commit
c57484f90a
1 changed files with 1 additions and 4 deletions
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue