Avoid to access some fields from dcc.c Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> --- server/dcc-encoders.c | 4 ++++ server/dcc.c | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/dcc-encoders.c b/server/dcc-encoders.c index fcb6e11..c49561f 100644 --- a/server/dcc-encoders.c +++ b/server/dcc-encoders.c @@ -705,6 +705,8 @@ gboolean dcc_get_glz_dictionary(EncodersData *enc, { GlzSharedDictionary *shared_dict; + spice_return_val_if_fail(!enc->glz_dict, FALSE); + pthread_mutex_lock(&glz_dictionary_list_lock); shared_dict = find_glz_dictionary(client, id); @@ -738,6 +740,8 @@ gboolean dcc_restore_glz_dictionary(EncodersData *enc, { GlzSharedDictionary *shared_dict = NULL; + spice_return_val_if_fail(!enc->glz_dict, FALSE); + pthread_mutex_lock(&glz_dictionary_list_lock); shared_dict = find_glz_dictionary(client, id); diff --git a/server/dcc.c b/server/dcc.c index 13ce0c5..6d74cd7 100644 --- a/server/dcc.c +++ b/server/dcc.c @@ -908,7 +908,6 @@ static int dcc_handle_init(DisplayChannelClient *dcc, SpiceMsgcDisplayInit *init init->pixmap_cache_size); spice_return_val_if_fail(dcc->pixmap_cache, FALSE); - spice_return_val_if_fail(!dcc->encoders.glz_dict, FALSE); success = dcc_get_glz_dictionary(&dcc->encoders, RED_CHANNEL_CLIENT(dcc)->client, init->glz_dictionary_id, @@ -1013,8 +1012,6 @@ int dcc_handle_message(RedChannelClient *rcc, uint32_t size, uint16_t type, void static int dcc_handle_migrate_glz_dictionary(DisplayChannelClient *dcc, SpiceMigrateDataDisplay *migrate) { - spice_return_val_if_fail(!dcc->encoders.glz_dict, FALSE); - return dcc_restore_glz_dictionary(&dcc->encoders, RED_CHANNEL_CLIENT(dcc)->client, migrate->glz_dict_id, -- 2.7.4 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel