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
d9f4dc52
Commit
d9f4dc52
authored
Oct 29, 2011
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only do 1 malloc instead of 3 and check for failure.
Signed-off-by:
Reimar Döffinger
<
Reimar.Doeffinger@gmx.de
>
parent
5c9b9165
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
proresenc.c
libavcodec/proresenc.c
+6
-6
No files found.
libavcodec/proresenc.c
View file @
d9f4dc52
...
...
@@ -549,9 +549,11 @@ static av_cold int prores_encode_init(AVCodecContext *avctx)
}
if
((
avctx
->
height
&
0xf
)
||
(
avctx
->
width
&
0xf
))
{
ctx
->
fill_y
=
av_malloc
(
DEFAULT_SLICE_MB_WIDTH
<<
9
);
ctx
->
fill_u
=
av_malloc
(
DEFAULT_SLICE_MB_WIDTH
<<
8
);
ctx
->
fill_v
=
av_malloc
(
DEFAULT_SLICE_MB_WIDTH
<<
8
);
ctx
->
fill_y
=
av_malloc
(
4
*
(
DEFAULT_SLICE_MB_WIDTH
<<
8
));
if
(
!
ctx
->
fill_y
)
return
AVERROR
(
ENOMEM
);
ctx
->
fill_u
=
ctx
->
fill_y
+
(
DEFAULT_SLICE_MB_WIDTH
<<
9
);
ctx
->
fill_v
=
ctx
->
fill_u
+
(
DEFAULT_SLICE_MB_WIDTH
<<
8
);
}
if
(
avctx
->
profile
==
FF_PROFILE_UNKNOWN
)
{
...
...
@@ -587,9 +589,7 @@ static av_cold int prores_encode_close(AVCodecContext *avctx)
{
ProresContext
*
ctx
=
avctx
->
priv_data
;
av_freep
(
&
avctx
->
coded_frame
);
av_free
(
ctx
->
fill_y
);
av_free
(
ctx
->
fill_u
);
av_free
(
ctx
->
fill_v
);
av_freep
(
&
ctx
->
fill_y
);
return
0
;
}
...
...
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