mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
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
1 changed files with 2 additions and 1 deletions
|
@ -1257,7 +1257,8 @@ switch_stream (GstValidatePipelineMonitor * monitor, GstValidateAction * action,
|
||||||
|
|
||||||
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;
|
||||||
}
|
} else
|
||||||
|
index %= n;
|
||||||
|
|
||||||
/* Add the new stream we want to switch to */
|
/* Add the new stream we want to switch to */
|
||||||
s = streams[index];
|
s = streams[index];
|
||||||
|
|
Loading…
Reference in a new issue