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
8616c5b7
Commit
8616c5b7
authored
Nov 26, 2014
by
Lukasz Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/options: fix leaks in avcodec_copy_context
Signed-off-by:
Lukasz Marek
<
lukasz.m.luki2@gmail.com
>
parent
66f379da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
options.c
libavcodec/options.c
+11
-5
No files found.
libavcodec/options.c
View file @
8616c5b7
...
...
@@ -190,6 +190,11 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
}
av_opt_free
(
dest
);
av_freep
(
&
dest
->
rc_override
);
av_freep
(
&
dest
->
intra_matrix
);
av_freep
(
&
dest
->
inter_matrix
);
av_freep
(
&
dest
->
extradata
);
av_freep
(
&
dest
->
subtitle_header
);
memcpy
(
dest
,
src
,
sizeof
(
*
dest
));
av_opt_copy
(
dest
,
src
);
...
...
@@ -206,6 +211,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
dest
->
slice_offset
=
NULL
;
dest
->
hwaccel
=
NULL
;
dest
->
internal
=
NULL
;
dest
->
coded_frame
=
NULL
;
/* reallocate values that should be allocated separately */
dest
->
extradata
=
NULL
;
...
...
@@ -225,6 +231,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
}
alloc_and_copy_or_fail
(
extradata
,
src
->
extradata_size
,
FF_INPUT_BUFFER_PADDING_SIZE
);
dest
->
extradata_size
=
src
->
extradata_size
;
alloc_and_copy_or_fail
(
intra_matrix
,
64
*
sizeof
(
int16_t
),
0
);
alloc_and_copy_or_fail
(
inter_matrix
,
64
*
sizeof
(
int16_t
),
0
);
alloc_and_copy_or_fail
(
rc_override
,
src
->
rc_override_count
*
sizeof
(
*
src
->
rc_override
),
0
);
...
...
@@ -239,11 +246,10 @@ fail:
av_freep
(
&
dest
->
intra_matrix
);
av_freep
(
&
dest
->
inter_matrix
);
av_freep
(
&
dest
->
extradata
);
#if FF_API_MPV_OPT
FF_DISABLE_DEPRECATION_WARNINGS
av_freep
(
&
dest
->
rc_eq
);
FF_ENABLE_DEPRECATION_WARNINGS
#endif
av_freep
(
&
dest
->
subtitle_header
);
dest
->
subtitle_header_size
=
0
;
dest
->
extradata_size
=
0
;
av_opt_free
(
dest
);
return
AVERROR
(
ENOMEM
);
}
...
...
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