Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
b2fcbc3a
Commit
b2fcbc3a
authored
Jul 15, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check asprintf return value and fix a potential memleak.
parent
4239976f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
src/input/es_out.c
src/input/es_out.c
+7
-10
No files found.
src/input/es_out.c
View file @
b2fcbc3a
...
...
@@ -177,12 +177,13 @@ static inline int EsOutGetClosedCaptionsChannel( vlc_fourcc_t fcc )
*****************************************************************************/
es_out_t
*
input_EsOutNew
(
input_thread_t
*
p_input
,
int
i_rate
)
{
es_out_t
*
out
=
malloc
(
sizeof
(
es_out_t
)
);
es_out_sys_t
*
p_sys
=
malloc
(
sizeof
(
es_out_sys_t
)
);
vlc_value_t
val
;
int
i
;
es_out_t
*
out
=
malloc
(
sizeof
(
es_out_t
)
);
if
(
!
out
)
return
NULL
;
es_out_sys_t
*
p_sys
=
malloc
(
sizeof
(
es_out_sys_t
)
);
if
(
!
p_sys
)
{
free
(
out
);
...
...
@@ -476,17 +477,13 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
{
if
(
psz_language
&&
*
psz_language
)
{
char
*
temp
;
text
.
psz_string
=
malloc
(
strlen
(
_
(
"Track %i"
)
)
+
strlen
(
psz_language
)
+
30
);
asprintf
(
&
temp
,
_
(
"Track %i"
),
val
.
i_int
);
sprintf
(
text
.
psz_string
,
"%s - [%s]"
,
temp
,
psz_language
);
free
(
temp
);
if
(
asprintf
(
&
text
.
psz_string
,
"%s %i - [%s]"
,
_
(
"Track"
),
val
.
i_int
,
psz_language
)
==
-
1
)
text
.
psz_string
=
NULL
;
}
else
{
text
.
psz_string
=
malloc
(
strlen
(
_
(
"Track %i"
)
)
+
20
);
sprintf
(
text
.
psz_string
,
_
(
"Track %i"
),
val
.
i_int
)
;
if
(
asprintf
(
&
text
.
psz_string
,
"%s %i"
,
_
(
"Track"
),
val
.
i_int
)
==
-
1
)
text
.
psz_string
=
NULL
;
}
}
...
...
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