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
c89e428e
Commit
c89e428e
authored
May 22, 2012
by
Jordi Ortiz
Committed by
Diego Biurrun
May 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwt: check malloc calls
Signed-off-by:
Diego Biurrun
<
diego@biurrun.de
>
parent
3ea54294
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
dwt.c
libavcodec/dwt.c
+15
-1
No files found.
libavcodec/dwt.c
View file @
c89e428e
...
...
@@ -33,10 +33,24 @@ void ff_slice_buffer_init(slice_buffer *buf, int line_count,
buf
->
line_width
=
line_width
;
buf
->
data_count
=
max_allocated_lines
;
buf
->
line
=
av_mallocz
(
sizeof
(
IDWTELEM
*
)
*
line_count
);
if
(
!
buf
->
line
)
return
AVERROR
(
ENOMEM
);
buf
->
data_stack
=
av_malloc
(
sizeof
(
IDWTELEM
*
)
*
max_allocated_lines
);
if
(
!
buf
->
data_stack
)
{
av_free
(
buf
->
line
);
return
AVERROR
(
ENOMEM
);
}
for
(
i
=
0
;
i
<
max_allocated_lines
;
i
++
)
for
(
i
=
0
;
i
<
max_allocated_lines
;
i
++
)
{
buf
->
data_stack
[
i
]
=
av_malloc
(
sizeof
(
IDWTELEM
)
*
line_width
);
if
(
!
buf
->
data_stack
[
i
])
{
for
(
i
--
;
i
>=
0
;
i
--
)
av_free
(
buf
->
data_stack
[
i
]);
av_free
(
buf
->
data_stack
);
av_free
(
buf
->
line
);
return
AVERROR
(
ENOMEM
);
}
}
buf
->
data_stack_top
=
max_allocated_lines
-
1
;
}
...
...
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