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
f2143d06
Commit
f2143d06
authored
Oct 05, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use vasprintf instead of some malloc+vsnprintf and fix CID 194.
parent
e30ee3d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
modules/video_filter/dynamicoverlay/dynamicoverlay_buffer.c
modules/video_filter/dynamicoverlay/dynamicoverlay_buffer.c
+6
-16
No files found.
modules/video_filter/dynamicoverlay/dynamicoverlay_buffer.c
View file @
f2143d06
...
@@ -121,24 +121,14 @@ int BufferPrintf( buffer_t *p_buffer, const char *p_fmt, ... )
...
@@ -121,24 +121,14 @@ int BufferPrintf( buffer_t *p_buffer, const char *p_fmt, ... )
int
status
;
int
status
;
char
*
psz_data
;
char
*
psz_data
;
va_list
va_list1
,
va_list2
;
va_list
va
;
va_start
(
va_list1
,
p_fmt
);
va_start
(
va
,
p_fmt
);
va_copy
(
va_list2
,
va_list1
);
i_len
=
vsnprintf
(
NULL
,
0
,
p_fmt
,
va_list1
);
i_len
=
vasprintf
(
&
psz_data
,
p_fmt
,
va
);
if
(
i_len
<
0
)
va_end
(
va
);
return
VLC_EGENERIC
;
if
(
i_len
==
-
1
)
va_end
(
va_list1
);
psz_data
=
malloc
(
i_len
+
1
);
if
(
psz_data
==
NULL
)
{
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
}
if
(
vsnprintf
(
psz_data
,
i_len
+
1
,
p_fmt
,
va_list2
)
!=
i_len
)
{
return
VLC_EGENERIC
;
}
va_end
(
va_list2
);
status
=
BufferAdd
(
p_buffer
,
psz_data
,
i_len
);
status
=
BufferAdd
(
p_buffer
,
psz_data
,
i_len
);
free
(
psz_data
);
free
(
psz_data
);
return
status
;
return
status
;
...
...
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