validate-scenario: Handle non-relative switch
Make sure we stay within the number of present streams (and avoid out-of-bound read). CID #1415470
This commit is contained in:
parent
81c3ab0b12
commit
ff6055b195
@ -1257,7 +1257,8 @@ switch_stream (GstValidatePipelineMonitor * monitor, GstValidateAction * action,
|
||||
|
||||
if (relative) { /* We are changing track relatively to current track */
|
||||
index = (current + index) % n;
|
||||
}
|
||||
} else
|
||||
index %= n;
|
||||
|
||||
/* Add the new stream we want to switch to */
|
||||
s = streams[index];
|
||||
|
Loading…
x
Reference in New Issue
Block a user