bitfocus / companion-module-renewedvision-pvp

MIT License
1 stars 2 forks source link

Fix: Negative indexes can cause PVP to crash. Added checks and logs errors. #13

Closed SteveTherrien closed 4 years ago

SteveTherrien commented 4 years ago

PVP allows layer, playlist, and cue IDs to be referenced in three different ways:

Negative indexes for layers/cues, and <= -2 for playlists, will crash PVP [playlist index -1 is valid and represents "Video Input"]. A bug report has been submitted to the vendor.

Actions that use these IDs must accept unstructured strings/UUID/indexes, so it's not practical to add regex validation to catch invalid indexes there.

Instead, this PR checks all use of layer/playlist/cue IDs, and if it's an invalid integer, throws an error. I wrapped the execution of the actions in a try/catch (which makes this PR look more complicated than it is) and logged any errors to self.log('error').

This is a workaround to prevent possible PVP crashes until the vendor patches the problem.

Tested in PVP 3.3.2 (50528776).