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
420719e1
Commit
420719e1
authored
Jan 21, 2012
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics: add do {} while 0 to macro.
Signed-off-by:
Reimar Döffinger
<
Reimar.Doeffinger@gmx.de
>
parent
0421b6dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
base64.c
libavutil/base64.c
+13
-12
No files found.
libavutil/base64.c
View file @
420719e1
...
@@ -68,13 +68,14 @@ static const uint8_t map2[256] =
...
@@ -68,13 +68,14 @@ static const uint8_t map2[256] =
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
};
};
#define BASE64_DEC_STEP(i) \
#define BASE64_DEC_STEP(i)
do {
\
bits = map2[in[i]]; \
bits = map2[in[i]]; \
if (bits & 0x80) \
if (bits & 0x80) \
goto out; \
goto out; \
v = (v << 6) + bits; \
v = (v << 6) + bits; \
if (i & 3) \
if (i & 3) \
*dst++ = v >> (6 - 2 * (i & 3)); \
*dst++ = v >> (6 - 2 * (i & 3)); \
} while(0)
int
av_base64_decode
(
uint8_t
*
out
,
const
char
*
in_str
,
int
out_size
)
int
av_base64_decode
(
uint8_t
*
out
,
const
char
*
in_str
,
int
out_size
)
{
{
...
@@ -87,29 +88,29 @@ int av_base64_decode(uint8_t *out, const char *in_str, int out_size)
...
@@ -87,29 +88,29 @@ int av_base64_decode(uint8_t *out, const char *in_str, int out_size)
v
=
0
;
v
=
0
;
while
(
end
-
dst
>
2
)
{
while
(
end
-
dst
>
2
)
{
BASE64_DEC_STEP
(
0
)
BASE64_DEC_STEP
(
0
)
;
BASE64_DEC_STEP
(
1
)
BASE64_DEC_STEP
(
1
)
;
BASE64_DEC_STEP
(
2
)
BASE64_DEC_STEP
(
2
)
;
BASE64_DEC_STEP
(
3
)
BASE64_DEC_STEP
(
3
)
;
in
+=
4
;
in
+=
4
;
}
}
if
(
end
-
dst
)
{
if
(
end
-
dst
)
{
BASE64_DEC_STEP
(
0
)
BASE64_DEC_STEP
(
0
)
;
BASE64_DEC_STEP
(
1
)
BASE64_DEC_STEP
(
1
)
;
if
(
end
-
dst
)
{
if
(
end
-
dst
)
{
BASE64_DEC_STEP
(
2
)
BASE64_DEC_STEP
(
2
)
;
in
++
;
in
++
;
}
}
in
+=
2
;
in
+=
2
;
}
}
while
(
1
)
{
while
(
1
)
{
BASE64_DEC_STEP
(
0
)
BASE64_DEC_STEP
(
0
)
;
in
++
;
in
++
;
BASE64_DEC_STEP
(
0
)
BASE64_DEC_STEP
(
0
)
;
in
++
;
in
++
;
BASE64_DEC_STEP
(
0
)
BASE64_DEC_STEP
(
0
)
;
in
++
;
in
++
;
BASE64_DEC_STEP
(
0
)
BASE64_DEC_STEP
(
0
)
;
in
++
;
in
++
;
}
}
...
...
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