Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Icecast-Server
Commits
de004670
Commit
de004670
authored
Dec 01, 2015
by
Joseph Wallace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be clearer about ebml_parse_sized_int's sign & endian behavior.
parent
e6cb7e26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
src/format_ebml.c
src/format_ebml.c
+10
-6
No files found.
src/format_ebml.c
View file @
de004670
...
@@ -959,19 +959,23 @@ static ssize_t ebml_parse_var_int(unsigned char *buffer,
...
@@ -959,19 +959,23 @@ static ssize_t ebml_parse_var_int(unsigned char *buffer,
return
size
;
return
size
;
}
}
/* Parse a
normal
int that may be from 1-8 bytes long.
/* Parse a
big-endian
int that may be from 1-8 bytes long.
* Returns 0 if there's not enough space to read the number;
* Returns 0 if there's not enough space to read the number;
* Returns -1 if the number is mis-sized.
* Returns -1 if the number is mis-sized.
* Else, returns the length of the number in bytes and writes the
* Else, returns the length of the number in bytes and writes the
* value to *out_value.
* value to *out_value.
* If is_signed is true, then the int is assumed to be two's complement
* signed, negative values will be correctly promoted, and the returned
* long long can be safely cast to a signed number on systems using
* two's complement arithmatic.
*/
*/
static
ssize_t
ebml_parse_sized_int
(
unsigned
char
*
buffer
,
static
ssize_t
ebml_parse_sized_int
(
unsigned
char
*
buffer
,
unsigned
char
*
buffer_end
,
unsigned
char
*
buffer_end
,
size_t
len
,
size_t
len
,
int
is_signed
,
int
is_signed
,
unsigned
long
long
*
out_value
)
unsigned
long
long
*
out_value
)
{
{
long
long
value
;
unsigned
long
long
value
;
size_t
i
;
size_t
i
;
if
(
len
<
1
||
len
>
8
)
{
if
(
len
<
1
||
len
>
8
)
{
...
...
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