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 b3643bd..dcefecd 100644 --- a/server/dcc-encoders.c +++ b/server/dcc-encoders.c @@ -706,6 +706,8 @@ gboolean image_encoders_get_glz_dictionary(ImageEncoders *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); @@ -739,6 +741,8 @@ gboolean image_encoders_restore_glz_dictionary(ImageEncoders *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 1994962..c935f8d 100644 --- a/server/dcc.c +++ b/server/dcc.c @@ -909,7 +909,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 = image_encoders_get_glz_dictionary(&dcc->encoders, RED_CHANNEL_CLIENT(dcc)->client, init->glz_dictionary_id, @@ -1014,8 +1013,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 image_encoders_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