From 57d75e67226f0d14c558a16dd4496defec234521 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 19 Nov 2012 22:51:50 +0100 Subject: [PATCH] play: Fix segfault if decoder is not supported. When paraslash was build without libmad, para_play still recognizes mp3 files (because the mp3 audio format handler does not require libmad), but decoding fails of course. Specifically, the check_filter_arg() call in load_file() fails, but the error handling code misses to clear the receiver node structure, which results in a subsequent seqfault due to a double free. This patch calls wipe_receiver_node() instead of open coding the cleanup. This fixes the bug and actually simplifies the code a bit. --- play.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/play.c b/play.c index 7537ddd6..047c959b 100644 --- a/play.c +++ b/play.c @@ -427,9 +427,7 @@ static int load_file(struct play_task *pt) register_writer_node(&pt->wn, pt->fn.btrn, &sched); return 1; fail: - afh_recv->close(&pt->rn); - btr_remove_node(&pt->rn.btrn); - afh_recv->free_config(pt->rn.conf); + wipe_receiver_node(pt); return ret; } -- 2.39.2