summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-06 17:27:05 +0200
committerwm4 <wm4@nowhere>2014-06-06 17:27:05 +0200
commitecbb12923fe50ae2b44120cc823fe0bf748dadf3 (patch)
treedb2946ff6c242fa875b941318a94bfa71c357d0c /player
parent4279712d1ed22faa7df0bcae281976590744d711 (diff)
downloadmpv-ecbb12923fe50ae2b44120cc823fe0bf748dadf3.tar.bz2
mpv-ecbb12923fe50ae2b44120cc823fe0bf748dadf3.tar.xz
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.
Diffstat (limited to 'player')
-rw-r--r--player/client.c2
1 files changed, 2 insertions, 0 deletions
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++) {