Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
b6093e8c
Commit
b6093e8c
authored
Feb 09, 2017
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hlsenc: Correctly write down all 16 bytes in hex
Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
bc258976
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
hlsenc.c
libavformat/hlsenc.c
+6
-5
No files found.
libavformat/hlsenc.c
View file @
b6093e8c
...
...
@@ -102,11 +102,12 @@ static void free_encryption(AVFormatContext *s)
av_freep
(
&
hls
->
key_basename
);
}
static
int
dict_set_bin
(
AVDictionary
**
dict
,
const
char
*
key
,
uint8_t
*
buf
)
static
int
dict_set_bin
(
AVDictionary
**
dict
,
const
char
*
key
,
uint8_t
*
buf
,
size_t
len
)
{
char
hex
[
33
];
ff_data_to_hex
(
hex
,
buf
,
sizeof
(
buf
)
,
0
);
ff_data_to_hex
(
hex
,
buf
,
len
,
0
);
hex
[
32
]
=
'\0'
;
return
av_dict_set
(
dict
,
key
,
hex
,
0
);
...
...
@@ -136,7 +137,7 @@ static int setup_encryption(AVFormatContext *s)
return
AVERROR
(
EINVAL
);
}
if
((
ret
=
dict_set_bin
(
&
hls
->
enc_opts
,
"key"
,
hls
->
key
))
<
0
)
if
((
ret
=
dict_set_bin
(
&
hls
->
enc_opts
,
"key"
,
hls
->
key
,
hls
->
key_len
))
<
0
)
return
ret
;
k
=
hls
->
key
;
}
else
{
...
...
@@ -145,7 +146,7 @@ static int setup_encryption(AVFormatContext *s)
return
ret
;
}
if
((
ret
=
dict_set_bin
(
&
hls
->
enc_opts
,
"key"
,
buf
))
<
0
)
if
((
ret
=
dict_set_bin
(
&
hls
->
enc_opts
,
"key"
,
buf
,
sizeof
(
buf
)
))
<
0
)
return
ret
;
k
=
buf
;
}
...
...
@@ -158,7 +159,7 @@ static int setup_encryption(AVFormatContext *s)
return
AVERROR
(
EINVAL
);
}
if
((
ret
=
dict_set_bin
(
&
hls
->
enc_opts
,
"iv"
,
hls
->
iv
))
<
0
)
if
((
ret
=
dict_set_bin
(
&
hls
->
enc_opts
,
"iv"
,
hls
->
iv
,
hls
->
iv_len
))
<
0
)
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment