diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-08-15 15:53:25 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-08-15 15:53:25 +0200 |
commit | b7d04aa20dfcdd460d8e1a81dafd9a80ab1f036f (patch) | |
tree | a7728f8bb698a46236e5eee1252d28a8db1ac3ad | |
parent | 9b801d6b0e356301bbbafcd3679c3b0c5aa1b0c7 (diff) |
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 <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r-- | src/ctl/ctl-sink.c | 8 |
1 files changed, 7 insertions, 1 deletions
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, "{<s>}", "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) { |