1
mirror of https://github.com/mpv-player/mpv synced 2024-11-03 03:19:24 +01:00

client API: don't update properties in uninitialized state

If an API user calls mpv_wait_event() and mpv_observe_property() before
mpv_initialize(), it could happen that a property was accessed before
initialization, which is not ok.
This commit is contained in:
wm4 2014-06-06 17:27:05 +02:00
parent 4279712d1e
commit ecbb12923f

View File

@ -1188,6 +1188,8 @@ static void update_prop(void *p)
// outstanding property.
static bool gen_property_change_event(struct mpv_handle *ctx)
{
if (!ctx->mpctx->initialized)
return false;
int start = ctx->lowest_changed;
ctx->lowest_changed = ctx->num_properties;
for (int n = start; n < ctx->num_properties; n++) {