From ecbb12923fe50ae2b44120cc823fe0bf748dadf3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 6 Jun 2014 17:27:05 +0200 Subject: [PATCH] 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. --- player/client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/player/client.c b/player/client.c index 257d8ffd42..eee401f089 100644 --- a/player/client.c +++ b/player/client.c @@ -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++) {