From b5e020daa2b02bae704c0ffa5cd303e8ed2b84c9 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 27 May 2016 13:23:48 +0200 Subject: [PATCH] validate: runner: prevent hash table modifications while iterating A GHashTableIter is invalided if the hash table is modified while we are iterating. Prevent this by taking the runner lock. Fix assertion warnings with validate.file.transcode.to_vorbis_and_vp8_in_webm.Sintel_2010_720p_mkv_srt Reviewed-by: Thibault Saunier Differential Revision: https://phabricator.freedesktop.org/D1026 --- validate/gst/validate/gst-validate-runner.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/validate/gst/validate/gst-validate-runner.c b/validate/gst/validate/gst-validate-runner.c index 867dc9c070..87298e8c9b 100644 --- a/validate/gst/validate/gst-validate-runner.c +++ b/validate/gst/validate/gst-validate-runner.c @@ -621,6 +621,9 @@ _do_report_synthesis (GstValidateRunner * runner) gpointer key, value; GList *criticals = NULL; + /* Take the lock so the hash table won't be modified while we are iterating + * over it */ + GST_VALIDATE_RUNNER_LOCK (runner); g_hash_table_iter_init (&iter, runner->priv->reports_by_type); while (g_hash_table_iter_next (&iter, &key, &value)) { GstValidateReport *report; @@ -647,6 +650,7 @@ _do_report_synthesis (GstValidateRunner * runner) gst_validate_report_print_description (report); gst_validate_printf (NULL, "\n"); } + GST_VALIDATE_RUNNER_UNLOCK (runner); return criticals; }