[vlc-commits] vout: remove xmalloc
victorien.lecouviour.tuffet@gmail.com
git at videolan.org
Fri Apr 28 09:16:48 CEST 2017
vlc | branch: master | victorien.lecouviour.tuffet at gmail.com <victorien.lecouviour.tuffet at gmail.com> | Tue Apr 25 21:21:56 2017 +0200| [2493f946353b3a8c36bd5795634c88f8cff27cae] | committer: Thomas Guillem
vout: remove xmalloc
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2493f946353b3a8c36bd5795634c88f8cff27cae
---
src/video_output/video_output.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 8b48a1cc8a..3538729d87 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -714,14 +714,22 @@ static void ThreadChangeFilters(vout_thread_t *vout,
char *next = config_ChainCreate(&name, &cfg, current);
if (name && *name) {
- vout_filter_t *e = xmalloc(sizeof(*e));
- e->name = name;
- e->cfg = cfg;
- if (!strcmp(e->name, "deinterlace") ||
- !strcmp(e->name, "postproc")) {
- vlc_array_append(&array_static, e);
- } else {
- vlc_array_append(&array_interactive, e);
+ vout_filter_t *e = malloc(sizeof(*e));
+
+ if (e) {
+ e->name = name;
+ e->cfg = cfg;
+ if (!strcmp(e->name, "deinterlace") ||
+ !strcmp(e->name, "postproc")) {
+ vlc_array_append(&array_static, e);
+ } else {
+ vlc_array_append(&array_interactive, e);
+ }
+ }
+ else {
+ if (cfg)
+ config_ChainDestroy(cfg);
+ free(name);
}
} else {
if (cfg)
More information about the vlc-commits
mailing list