From b7d04aa20dfcdd460d8e1a81dafd9a80ab1f036f Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Fri, 15 Aug 2014 15:53:25 +0200 Subject: [PATCH] sink: exit header/body in case rtsp_message_readv() fails rtsp_message_readv() is a convenience function. If one of the values to be read fails, it does not restore the previous situation. Therefore, handle that in sinkctl in case we cannot read a value. Reported-by: Andrey Gusakov Signed-off-by: David Herrmann --- src/ctl/ctl-sink.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ctl/ctl-sink.c b/src/ctl/ctl-sink.c index c554bc9..bc32bf9 100644 --- a/src/ctl/ctl-sink.c +++ b/src/ctl/ctl-sink.c @@ -215,10 +215,16 @@ static void sink_handle_set_parameter(struct ctl_sink *s, } } + rtsp_message_exit_header(m); + rtsp_message_exit_body(m); + /* M5 */ r = rtsp_message_read(m, "{}", "wfd_trigger_method", &trigger); - if (r < 0) + if (r < 0) { + rtsp_message_exit_header(m); + rtsp_message_exit_body(m); return; + } if (!strcmp(trigger, "SETUP")) { if (!s->url) {