diff options
author | Edward Hervey <edward@centricular.com> | 2017-11-22 16:34:42 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2017-11-22 16:37:44 +0100 |
commit | 81c3ab0b12ec80b5c0bfb8fd99c1bd0aa04d73b7 (patch) | |
tree | 0a0ff10af1a8e31725d7c697e4a788a988e9f609 | |
parent | aa7f753f8aefefa708df79606ebee14ff6ac430f (diff) |
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
-rw-r--r-- | validate/gst/validate/gst-validate-scenario.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index 3c8abe8..11bda7f 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -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 */ index = (current + index) % n; } |