Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
4a440e8c
Commit
4a440e8c
authored
Jun 10, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a52: avoid overflow conversion to signed integer
parent
9acdb09e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
modules/audio_filter/converter/a52tofloat32.c
modules/audio_filter/converter/a52tofloat32.c
+17
-5
No files found.
modules/audio_filter/converter/a52tofloat32.c
View file @
4a440e8c
...
...
@@ -236,7 +236,10 @@ static void Interleave( sample_t *restrict p_out, const sample_t *restrict p_in,
for
(
unsigned
i
=
0
;
i
<
256
;
i
++
)
{
#ifdef LIBA52_FIXED
p_out
[
i
*
i_nb_channels
+
pi_chan_table
[
j
]]
=
((
uint32_t
)
p_in
[
j
*
256
+
i
])
<<
4
;
union
{
uint32_t
u
;
int32_t
i
;
}
spl
;
spl
.
u
=
((
uint32_t
)
p_in
[
j
*
256
+
i
])
<<
4
;
p_out
[
i
*
i_nb_channels
+
pi_chan_table
[
j
]]
=
spl
.
i
;
#else
p_out
[
i
*
i_nb_channels
+
pi_chan_table
[
j
]]
=
p_in
[
j
*
256
+
i
];
#endif
...
...
@@ -252,12 +255,17 @@ static void Duplicate( sample_t *restrict p_out, const sample_t *restrict p_in )
for
(
unsigned
i
=
256
;
i
--
;
)
{
#ifdef LIBA52_FIXED
sample_t
s
=
((
uint32_t
)
*
(
p_in
++
))
<<
4
;
union
{
uint32_t
u
;
int32_t
i
;
}
spl
;
spl
.
u
=
((
uint32_t
)
*
(
p_in
++
))
<<
4
;
*
p_out
++
=
spl
.
i
;
*
p_out
++
=
spl
.
i
;
#else
sample_t
s
=
*
(
p_in
++
);
#endif
*
p_out
++
=
s
;
*
p_out
++
=
s
;
#endif
}
}
...
...
@@ -272,8 +280,12 @@ static void Exchange( sample_t *restrict p_out, const sample_t *restrict p_in )
for
(
unsigned
i
=
0
;
i
<
256
;
i
++
)
{
#ifdef LIBA52_FIXED
*
p_out
++
=
((
uint32_t
)
*
p_first
++
)
<<
4
;
*
p_out
++
=
((
uint32_t
)
*
p_second
++
)
<<
4
;
uint32_t
spl
[
2
];
spl
[
0
]
=
((
uint32_t
)
*
p_first
++
)
<<
4
;
spl
[
1
]
=
((
uint32_t
)
*
p_second
++
)
<<
4
;
memcpy
(
p_out
,
spl
,
sizeof
(
spl
)
);
p_out
+=
2
;
#else
*
p_out
++
=
*
p_first
++
;
*
p_out
++
=
*
p_second
++
;
...
...
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