From: Andre Noll Date: Mon, 19 Nov 2012 21:51:50 +0000 (+0100) Subject: play: Fix segfault if decoder is not supported. X-Git-Tag: v0.4.12~7^2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=57d75e67226f0d14c558a16dd4496defec234521;p=paraslash.git 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. --- 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; }