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
bf96937a
Commit
bf96937a
authored
Jan 03, 2019
by
Oliver Collyer
Committed by
James Almer
Jan 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avdevice/dshow: Fixed some minor memory leaks
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
5402c188
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
dshow.c
libavdevice/dshow.c
+9
-3
dshow_pin.c
libavdevice/dshow_pin.c
+13
-1
No files found.
libavdevice/dshow.c
View file @
bf96937a
...
...
@@ -278,12 +278,12 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
goto
fail1
;
}
*
device_unique_name
=
unique_name
;
unique_name
=
NULL
;
// success, loop will end now
}
}
else
{
av_log
(
avctx
,
AV_LOG_INFO
,
"
\"
%s
\"\n
"
,
friendly_name
);
av_log
(
avctx
,
AV_LOG_INFO
,
" Alternative name
\"
%s
\"\n
"
,
unique_name
);
av_free
(
unique_name
);
}
fail1:
...
...
@@ -291,7 +291,8 @@ fail1:
IMalloc_Free
(
co_malloc
,
olestr
);
if
(
bind_ctx
)
IBindCtx_Release
(
bind_ctx
);
av_free
(
friendly_name
);
av_freep
(
&
friendly_name
);
av_freep
(
&
unique_name
);
if
(
bag
)
IPropertyBag_Release
(
bag
);
IMoniker_Release
(
m
);
...
...
@@ -941,6 +942,8 @@ dshow_add_device(AVFormatContext *avctx,
AVStream
*
st
;
int
ret
=
AVERROR
(
EIO
);
type
.
pbFormat
=
NULL
;
st
=
avformat_new_stream
(
avctx
,
NULL
);
if
(
!
st
)
{
ret
=
AVERROR
(
ENOMEM
);
...
...
@@ -989,7 +992,8 @@ dshow_add_device(AVFormatContext *avctx,
if
(
par
->
codec_id
==
AV_CODEC_ID_NONE
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown compression type. "
"Please report type 0x%X.
\n
"
,
(
int
)
bih
->
biCompression
);
return
AVERROR_PATCHWELCOME
;
ret
=
AVERROR_PATCHWELCOME
;
goto
error
;
}
par
->
bits_per_coded_sample
=
bih
->
biBitCount
;
}
else
{
...
...
@@ -1030,6 +1034,8 @@ dshow_add_device(AVFormatContext *avctx,
ret
=
0
;
error:
if
(
type
.
pbFormat
)
CoTaskMemFree
(
type
.
pbFormat
);
return
ret
;
}
...
...
libavdevice/dshow_pin.c
View file @
bf96937a
...
...
@@ -249,8 +249,20 @@ libAVPin_Setup(libAVPin *this, libAVFilter *filter)
return
1
;
}
static
void
libAVPin_Free
(
libAVPin
*
this
)
{
if
(
!
this
)
return
;
av_freep
(
&
this
->
imemvtbl
);
if
(
this
->
type
.
pbFormat
)
{
CoTaskMemFree
(
this
->
type
.
pbFormat
);
this
->
type
.
pbFormat
=
NULL
;
}
}
DECLARE_CREATE
(
libAVPin
,
libAVPin_Setup
(
this
,
filter
),
libAVFilter
*
filter
)
DECLARE_DESTROY
(
libAVPin
,
nothing
)
DECLARE_DESTROY
(
libAVPin
,
libAVPin_Free
)
/*****************************************************************************
* libAVMemInputPin
...
...
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