mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-03 17:22:29 +00:00
validate:scenario: Do not switch relative track when no track of type avalaible
This case was not handled and leaded to a division by zero.
This commit is contained in:
parent
446c619dea
commit
cd78d29c56
1 changed files with 9 additions and 0 deletions
|
@ -1035,6 +1035,15 @@ execute_switch_track_pb (GstValidateScenario * scenario,
|
|||
}
|
||||
|
||||
if (relative) { /* We are changing track relatively to current track */
|
||||
if (n == 0) {
|
||||
GST_VALIDATE_REPORT (scenario, SCENARIO_ACTION_EXECUTION_ERROR,
|
||||
"Trying to execute a relative %s when there for %s track when there"
|
||||
" is no track of this type available on current stream.",
|
||||
action->type, type);
|
||||
|
||||
return GST_VALIDATE_EXECUTE_ACTION_ERROR;
|
||||
}
|
||||
|
||||
index = (current + index) % n;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue