1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

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>
This commit is contained in:
David Herrmann 2014-08-15 15:53:25 +02:00
parent 9b801d6b0e
commit b7d04aa20d

View file

@ -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) {