mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +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[] ivDataWithPadding = new byte[16];
|
||||
System.arraycopy(ivData, 0, ivDataWithPadding, ivDataWithPadding.length - ivData.length,
|
||||
ivData.length);
|
||||
int offset = ivData.length > 16 ? ivData.length - 16 : 0;
|
||||
System.arraycopy(ivData, offset, ivDataWithPadding, ivDataWithPadding.length - ivData.length
|
||||
+ offset, ivData.length - offset);
|
||||
|
||||
encryptedDataSource = new Aes128DataSource(secretKey, ivDataWithPadding, upstreamDataSource);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue