[PATCH] fixed #2092
authorjeanlf <jeanlf@gpac.io>
Tue, 1 Feb 2022 14:28:23 +0000 (15:28 +0100)
committerMoritz Mühlenhoff <jmm@debian.org>
Mon, 19 Jun 2023 21:46:06 +0000 (22:46 +0100)
Gbp-Pq: Name CVE-2021-4043.patch

src/isomedia/box_code_base.c

index 280b351739375e7d6817e3156c5349d0795b063c..4de52f0d0e5a5ccb0b7b41e4b7b2b745e18379d1 100644 (file)
@@ -10672,10 +10672,12 @@ void gitn_box_del(GF_Box *s)
        u32 i;
        GroupIdToNameBox *ptr = (GroupIdToNameBox *)s;
        if (ptr == NULL) return;
-       for (i=0; i<ptr->nb_entries; i++) {
-               if (ptr->entries[i].name) gf_free(ptr->entries[i].name);
+       if (ptr->entries) {
+               for (i=0; i<ptr->nb_entries; i++) {
+                       if (ptr->entries[i].name) gf_free(ptr->entries[i].name);
+               }
+               gf_free(ptr->entries);
        }
-       if (ptr->entries) gf_free(ptr->entries);
        gf_free(ptr);
 }