Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
70808859
Commit
70808859
authored
Jun 16, 2017
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_hwmap: Properly free a locally derived device
Fixes CID 1412853. (cherry picked from commit
a670eea5
)
parent
d984b29b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
vf_hwmap.c
libavfilter/vf_hwmap.c
+7
-1
No files found.
libavfilter/vf_hwmap.c
View file @
70808859
...
...
@@ -58,7 +58,7 @@ static int hwmap_config_output(AVFilterLink *outlink)
AVHWFramesContext
*
hwfc
;
AVBufferRef
*
device
;
const
AVPixFmtDescriptor
*
desc
;
int
err
;
int
err
,
device_is_derived
;
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Configure hwmap %s -> %s.
\n
"
,
av_get_pix_fmt_name
(
inlink
->
format
),
...
...
@@ -67,6 +67,7 @@ static int hwmap_config_output(AVFilterLink *outlink)
av_buffer_unref
(
&
ctx
->
hwframes_ref
);
device
=
avctx
->
hw_device_ctx
;
device_is_derived
=
0
;
if
(
inlink
->
hw_frames_ctx
)
{
hwfc
=
(
AVHWFramesContext
*
)
inlink
->
hw_frames_ctx
->
data
;
...
...
@@ -88,6 +89,7 @@ static int hwmap_config_output(AVFilterLink *outlink)
"device context: %d.
\n
"
,
err
);
goto
fail
;
}
device_is_derived
=
1
;
}
desc
=
av_pix_fmt_desc_get
(
outlink
->
format
);
...
...
@@ -242,9 +244,13 @@ static int hwmap_config_output(AVFilterLink *outlink)
outlink
->
w
=
inlink
->
w
;
outlink
->
h
=
inlink
->
h
;
if
(
device_is_derived
)
av_buffer_unref
(
&
device
);
return
0
;
fail:
if
(
device_is_derived
)
av_buffer_unref
(
&
device
);
av_buffer_unref
(
&
ctx
->
hwframes_ref
);
return
err
;
}
...
...
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