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
3dbf5690
Commit
3dbf5690
authored
Sep 02, 2014
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huffyuvdec: avoid large stack use.
Signed-off-by:
Reimar Döffinger
<
Reimar.Doeffinger@gmx.de
>
parent
092d1977
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
huffyuvdec.c
libavcodec/huffyuvdec.c
+13
-6
No files found.
libavcodec/huffyuvdec.c
View file @
3dbf5690
...
...
@@ -115,10 +115,14 @@ static int read_len_table(uint8_t *dst, GetBitContext *gb, int n)
static
int
generate_joint_tables
(
HYuvContext
*
s
)
{
uint16_t
symbols
[
1
<<
VLC_BITS
];
uint16_t
bits
[
1
<<
VLC_BITS
];
uint8_t
len
[
1
<<
VLC_BITS
];
int
ret
;
uint16_t
*
symbols
=
av_mallocz
(
5
<<
VLC_BITS
);
uint16_t
*
bits
;
uint8_t
*
len
;
if
(
!
symbols
)
return
AVERROR
(
ENOMEM
);
bits
=
symbols
+
(
1
<<
VLC_BITS
);
len
=
(
uint8_t
*
)(
bits
+
(
1
<<
VLC_BITS
));
if
(
s
->
bitstream_bpp
<
24
||
s
->
version
>
2
)
{
int
p
,
i
,
y
,
u
;
...
...
@@ -147,7 +151,7 @@ static int generate_joint_tables(HYuvContext *s)
ff_free_vlc
(
&
s
->
vlc
[
4
+
p
]);
if
((
ret
=
ff_init_vlc_sparse
(
&
s
->
vlc
[
4
+
p
],
VLC_BITS
,
i
,
len
,
1
,
1
,
bits
,
2
,
2
,
symbols
,
2
,
2
,
0
))
<
0
)
return
re
t
;
goto
ou
t
;
}
}
else
{
uint8_t
(
*
map
)[
4
]
=
(
uint8_t
(
*
)[
4
])
s
->
pix_bgr_map
;
...
...
@@ -191,9 +195,12 @@ static int generate_joint_tables(HYuvContext *s)
ff_free_vlc
(
&
s
->
vlc
[
4
]);
if
((
ret
=
init_vlc
(
&
s
->
vlc
[
4
],
VLC_BITS
,
i
,
len
,
1
,
1
,
bits
,
2
,
2
,
0
))
<
0
)
return
re
t
;
goto
ou
t
;
}
return
0
;
ret
=
0
;
out:
av_freep
(
&
symbols
);
return
ret
;
}
static
int
read_huffman_tables
(
HYuvContext
*
s
,
const
uint8_t
*
src
,
int
length
)
...
...
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