[rhythmbox] audiocd: initialise the rest of the parser context



commit 6f46362f9ed72df243974cda4c68835a020e7915
Author: Jonathan Matthew <jonathan d14n org>
Date:   Wed Dec 26 18:41:58 2018 +1000

    audiocd: initialise the rest of the parser context
    
    The attribute map also needs to be initialised.  Might fix
    https://gitlab.gnome.org/GNOME/rhythmbox/issues/1660

 plugins/audiocd/rb-musicbrainz-lookup.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/plugins/audiocd/rb-musicbrainz-lookup.c b/plugins/audiocd/rb-musicbrainz-lookup.c
index e73546371..175411496 100644
--- a/plugins/audiocd/rb-musicbrainz-lookup.c
+++ b/plugins/audiocd/rb-musicbrainz-lookup.c
@@ -282,6 +282,9 @@ start_element (GMarkupParseContext *pctx,
                }
        }
 
+       if (ctx->map == NULL)
+               return;
+
        path = get_path (ctx);
        for (i = 0; ctx->map[i].path != NULL; i++) {
                if (g_strcmp0 (path, ctx->map[i].path) == 0) {
@@ -361,6 +364,7 @@ rb_musicbrainz_data_parse (const char *data, gssize len, GError **error)
        ctx.text.len = 0;
        ctx.text.allocated_len = 0;
        ctx.item = NULL;
+       ctx.map = NULL;
        g_queue_init (&ctx.path);
 
        pctx = g_markup_parse_context_new (&parser, 0, &ctx, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]