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
ee90119e
Commit
ee90119e
authored
Sep 17, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
binkaudio: remove unneeded GET_BITS_SAFE macro
Normal get_bits() already has overread protection.
parent
7bfd1766
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
binkaudio.c
libavcodec/binkaudio.c
+5
-12
No files found.
libavcodec/binkaudio.c
View file @
ee90119e
...
...
@@ -158,12 +158,6 @@ static const uint8_t rle_length_tab[16] = {
2
,
3
,
4
,
5
,
6
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
32
,
64
};
#define GET_BITS_SAFE(out, nbits) do { \
if (get_bits_left(gb) < nbits) \
return AVERROR_INVALIDDATA; \
out = get_bits(gb, nbits); \
} while (0)
/**
* Decode Bink Audio block
* @param[out] out Output buffer (must contain s->block_size elements)
...
...
@@ -210,10 +204,9 @@ static int decode_block(BinkAudioContext *s, float **out, int use_dct)
if
(
s
->
version_b
)
{
j
=
i
+
16
;
}
else
{
int
v
;
GET_BITS_SAFE
(
v
,
1
);
int
v
=
get_bits1
(
gb
);
if
(
v
)
{
GET_BITS_SAFE
(
v
,
4
);
v
=
get_bits
(
gb
,
4
);
j
=
i
+
rle_length_tab
[
v
]
*
8
;
}
else
{
j
=
i
+
8
;
...
...
@@ -222,7 +215,7 @@ static int decode_block(BinkAudioContext *s, float **out, int use_dct)
j
=
FFMIN
(
j
,
s
->
frame_len
);
GET_BITS_SAFE
(
width
,
4
);
width
=
get_bits
(
gb
,
4
);
if
(
width
==
0
)
{
memset
(
coeffs
+
i
,
0
,
(
j
-
i
)
*
sizeof
(
*
coeffs
));
i
=
j
;
...
...
@@ -232,10 +225,10 @@ static int decode_block(BinkAudioContext *s, float **out, int use_dct)
while
(
i
<
j
)
{
if
(
s
->
bands
[
k
]
==
i
)
q
=
quant
[
k
++
];
GET_BITS_SAFE
(
coeff
,
width
);
coeff
=
get_bits
(
gb
,
width
);
if
(
coeff
)
{
int
v
;
GET_BITS_SAFE
(
v
,
1
);
v
=
get_bits1
(
gb
);
if
(
v
)
coeffs
[
i
]
=
-
q
*
coeff
;
else
...
...
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