[PATCH] fixed #1990
authorjeanlf <jeanlf@gpac.io>
Wed, 15 Dec 2021 08:49:28 +0000 (09:49 +0100)
committerMoritz Mühlenhoff <jmm@debian.org>
Mon, 19 Jun 2023 21:46:06 +0000 (22:46 +0100)
Gbp-Pq: Name CVE-2021-45831.patch

src/scenegraph/svg_attributes.c

index f81c4c462a03d6895061c68816e98627b7ec27d3..9dd078f298b92831b294061074f5dd30ae949244 100644 (file)
@@ -4548,7 +4548,7 @@ char *gf_svg_dump_attribute(GF_Node *elt, GF_FieldInfo *info)
        case SVG_FontFamily_datatype:
        {
                SVG_FontFamily *f = (SVG_FontFamily *)info->far_ptr;
-               return gf_strdup( (f->type==SVG_FONTFAMILY_INHERIT) ? "inherit" : (const char *) f->value);
+               return gf_strdup( (!f->value || (f->type==SVG_FONTFAMILY_INHERIT)) ? "inherit" : (const char *) f->value);
        }
 
        case SVG_PreserveAspectRatio_datatype:
@@ -4886,7 +4886,7 @@ char *gf_svg_dump_attribute_indexed(GF_Node *elt, GF_FieldInfo *info)
        case SVG_PointerEvents_datatype:
                break;
        case XMLRI_List_datatype:
-               return gf_strdup( (char *) info->far_ptr);
+               return gf_strdup(info->far_ptr ? (char *) info->far_ptr : "");
 
        case SVG_Points_datatype:
        {