Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
x264
Commits
da6b29b5
Commit
da6b29b5
authored
Apr 01, 2018
by
Anton Mitrofanov
Committed by
Henrik Gramner
May 27, 2018
Browse files
Fix possible undefined behavior of right shift
32-bit shifts are only defined for values in the range 0-31.
parent
7e457290
Changes
1
Show whitespace changes
Inline
Side-by-side
common/bitstream.h
View file @
da6b29b5
...
...
@@ -89,8 +89,13 @@ static inline void bs_init( bs_t *s, void *p_data, int i_data )
s
->
p
=
s
->
p_start
=
(
uint8_t
*
)
p_data
-
offset
;
s
->
p_end
=
(
uint8_t
*
)
p_data
+
i_data
;
s
->
i_left
=
(
WORD_SIZE
-
offset
)
*
8
;
if
(
offset
)
{
s
->
cur_bits
=
endian_fix32
(
M32
(
s
->
p
)
);
s
->
cur_bits
>>=
(
4
-
offset
)
*
8
;
}
else
s
->
cur_bits
=
0
;
}
static
inline
int
bs_pos
(
bs_t
*
s
)
{
...
...
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