libobs: Handle obs_scene_add failure
Previously a NULL item would cause a crash when reading transform info.
The crash can be reproduced by e.g. editing scenes.json so that two
scenes contain each other. Example scenes.json:
{
"current_scene": "Scene",
"sources": [
{
"flags": 0,
"id": "scene",
"mixers": 0,
"name": "Scene",
"settings": {
"items": [
{
"align": 5,
"bounds": {
"x": 1440.0,
"y": 900.0
},
"bounds_align": 0,
"bounds_type": 2,
"name": "Scene 2",
"pos": {
"x": 0.0,
"y": 0.0
},
"rot": 0.0,
"scale": {
"x": 1.0,
"y": 1.0
},
"visible": true
}
]
},
"sync": 0,
"volume": 1.0
},
{
"flags": 0,
"id": "scene",
"mixers": 0,
"name": "Scene 2",
"settings": {
"items": [
{
"align": 5,
"bounds": {
"x": 1.0,
"y": 1.0
},
"bounds_align": 0,
"bounds_type": 0,
"name": "Scene",
"pos": {
"x": 854.0,
"y": -520.0
},
"rot": 0.0,
"scale": {
"x": 1.75,
"y": 1.7562724351882935
},
"visible": true
}
]
},
"sync": 0,
"volume": 1.0
}
]
}