mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 05:56:31 +00:00
validate-scenario: Handle switching stream of type not present
Unlikely to happen, but at least don't end up doing unsafe calculation with n == 0 afterwards CID #1415453
This commit is contained in:
parent
aa7f753f8a
commit
81c3ab0b12
1 changed files with 5 additions and 0 deletions
|
@ -1250,6 +1250,11 @@ switch_stream (GstValidatePipelineMonitor * monitor, GstValidateAction * action,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (G_UNLIKELY (n == 0)) {
|
||||||
|
GST_ERROR ("No streams available of the required type");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
if (relative) { /* We are changing track relatively to current track */
|
if (relative) { /* We are changing track relatively to current track */
|
||||||
index = (current + index) % n;
|
index = (current + index) % n;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue