Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
a6a3652d
Commit
a6a3652d
authored
Jul 30, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
videotoolbox: fix memleak
parent
4ca4c7e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
modules/codec/videotoolbox.m
modules/codec/videotoolbox.m
+12
-2
No files found.
modules/codec/videotoolbox.m
View file @
a6a3652d
...
...
@@ -249,7 +249,7 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t *p_block)
}
uint32_t
size
;
void
*
p_buf
;
void
*
p_buf
,
*
p_alloc_buf
=
NULL
;
int
i_ret
=
0
;
if
(
p_block
==
NULL
)
{
...
...
@@ -257,7 +257,7 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t *p_block)
uint32_t
i_nal_size
=
0
;
size
=
p_dec
->
fmt_in
.
i_extra
;
p_buf
=
malloc
(
buf_size
);
p_
alloc_buf
=
p_
buf
=
malloc
(
buf_size
);
if
(
!
p_buf
)
{
msg_Warn
(
p_dec
,
"extra buffer allocation failed"
);
...
...
@@ -283,12 +283,14 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t *p_block)
}
if
(
i_ret
!=
VLC_SUCCESS
)
{
free
(
p_alloc_buf
);
return
VLC_EGENERIC
;
}
uint8_t
*
p_sps_buf
=
NULL
,
*
p_pps_buf
=
NULL
;
size_t
i_sps_size
=
0
,
i_pps_size
=
0
;
if
(
!
p_buf
)
{
free
(
p_alloc_buf
);
return
VLC_EGENERIC
;
}
...
...
@@ -303,6 +305,7 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t *p_block)
if
(
i_ret
!=
VLC_SUCCESS
)
{
msg_Warn
(
p_dec
,
"sps pps parsing failed"
);
free
(
p_alloc_buf
);
return
VLC_EGENERIC
;
}
...
...
@@ -313,6 +316,7 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t *p_block)
if
(
i_ret
!=
VLC_SUCCESS
)
{
free
(
p_alloc_buf
);
return
VLC_EGENERIC
;
}
/* this data is more trust-worthy than what we receive
...
...
@@ -332,7 +336,10 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t *p_block)
bool
status
=
bo_init
(
&
bo
,
1024
);
if
(
status
!=
true
)
{
free
(
p_alloc_buf
);
return
VLC_ENOMEM
;
}
bo_add_8
(
&
bo
,
1
);
/* configuration version */
bo_add_8
(
&
bo
,
sps_data
.
i_profile
);
...
...
@@ -368,10 +375,12 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t *p_block)
bo_add_mem
(
&
bo
,
i_pps_size
-
4
,
fixed_pps
);
free
(
fixed_pps
);
}
free
(
p_alloc_buf
);
extradata
=
CFDataCreate
(
kCFAllocatorDefault
,
bo
.
b
->
p_buffer
,
bo
.
b
->
i_buffer
);
bo_deinit
(
&
bo
);
if
(
extradata
)
CFDictionarySetValue
(
extradata_info
,
CFSTR
(
"avcC"
),
extradata
);
...
...
@@ -717,6 +726,7 @@ static CFDataRef ESDSCreate(decoder_t *p_dec, uint8_t *p_buf, uint32_t i_buf_siz
CFDataRef
data
=
CFDataCreate
(
kCFAllocatorDefault
,
bo
.
b
->
p_buffer
,
bo
.
b
->
i_buffer
);
bo_deinit
(
&
bo
);
return
data
;
}
...
...
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