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:
parent
9b801d6b0e
commit
b7d04aa20d
1 changed files with 7 additions and 1 deletions
|
@ -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 */
|
/* M5 */
|
||||||
r = rtsp_message_read(m, "{<s>}", "wfd_trigger_method", &trigger);
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!strcmp(trigger, "SETUP")) {
|
if (!strcmp(trigger, "SETUP")) {
|
||||||
if (!s->url) {
|
if (!s->url) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue