Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libdca
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
libdca
Commits
e3832887
Commit
e3832887
authored
16 years ago
by
Sam Hocevar
Browse files
Options
Downloads
Patches
Plain Diff
* bitstream.c: fix random crashes caused by invalid 32-bit shifts on 32-bit
values.
parent
38a4a894
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libdca/bitstream.c
+9
-6
9 additions, 6 deletions
libdca/bitstream.c
with
9 additions
and
6 deletions
libdca/bitstream.c
+
9
−
6
View file @
e3832887
...
...
@@ -25,6 +25,7 @@
#include
"config.h"
#include
<stdio.h>
#include
<inttypes.h>
#include
"dca.h"
...
...
@@ -46,7 +47,7 @@ void dca_bitstream_init (dca_state_t * state, uint8_t * buf, int word_mode,
state
->
bigendian_mode
=
bigendian_mode
;
bitstream_get
(
state
,
align
*
8
);
}
#include
<stdio.h>
static
inline
void
bitstream_fill_current
(
dca_state_t
*
state
)
{
uint32_t
tmp
;
...
...
@@ -76,12 +77,14 @@ static inline void bitstream_fill_current (dca_state_t * state)
uint32_t
dca_bitstream_get_bh
(
dca_state_t
*
state
,
uint32_t
num_bits
)
{
uint32_t
result
;
num_bits
-=
state
->
bits_left
;
uint32_t
result
=
0
;
result
=
((
state
->
current_word
<<
(
32
-
state
->
bits_left
))
>>
(
32
-
state
->
bits_left
));
if
(
state
->
bits_left
)
{
num_bits
-=
state
->
bits_left
;
result
=
((
state
->
current_word
<<
(
32
-
state
->
bits_left
))
>>
(
32
-
state
->
bits_left
));
}
if
(
!
state
->
word_mode
&&
num_bits
>
28
)
{
bitstream_fill_current
(
state
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment