mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Additional IV fix. Trim sign bit from BigInteger.toByteArray() output, if it creates a 17th byte for it. #145
This commit is contained in:
parent
15d3df6a58
commit
3cfe894b93
1 changed files with 3 additions and 2 deletions
|
|
@ -395,8 +395,9 @@ public class HlsChunkSource {
|
||||||
|
|
||||||
byte[] ivData = new BigInteger(iv, 16).toByteArray();
|
byte[] ivData = new BigInteger(iv, 16).toByteArray();
|
||||||
byte[] ivDataWithPadding = new byte[16];
|
byte[] ivDataWithPadding = new byte[16];
|
||||||
System.arraycopy(ivData, 0, ivDataWithPadding, ivDataWithPadding.length - ivData.length,
|
int offset = ivData.length > 16 ? ivData.length - 16 : 0;
|
||||||
ivData.length);
|
System.arraycopy(ivData, offset, ivDataWithPadding, ivDataWithPadding.length - ivData.length
|
||||||
|
+ offset, ivData.length - offset);
|
||||||
|
|
||||||
encryptedDataSource = new Aes128DataSource(secretKey, ivDataWithPadding, upstreamDataSource);
|
encryptedDataSource = new Aes128DataSource(secretKey, ivDataWithPadding, upstreamDataSource);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue