[PATCH] fixed #1890
authorjeanlf <jeanlf@gpac.io>
Mon, 30 Aug 2021 13:55:13 +0000 (15:55 +0200)
committerMoritz Mühlenhoff <jmm@debian.org>
Mon, 19 Jun 2023 21:46:06 +0000 (22:46 +0100)
Gbp-Pq: Name CVE-2021-40569.patch

src/isomedia/box_code_meta.c

index 1d54fa6653e1f41b3e0be07ef27bb60bc01f3ae5..6c571c456edb00e21f16032582caaf9913a613fb 100644 (file)
@@ -285,7 +285,8 @@ GF_Err iloc_box_read(GF_Box *s, GF_BitStream *bs)
        }
 
        for (i = 0; i < item_count; i++) {
-               GF_ItemLocationEntry *location_entry = (GF_ItemLocationEntry *)gf_malloc(sizeof(GF_ItemLocationEntry));
+               GF_ItemLocationEntry *location_entry;
+               GF_SAFEALLOC(location_entry, GF_ItemLocationEntry);
                if (!location_entry) return GF_OUT_OF_MEM;
 
                gf_list_add(ptr->location_entries, location_entry);
@@ -314,7 +315,8 @@ GF_Err iloc_box_read(GF_Box *s, GF_BitStream *bs)
                extent_count = gf_bs_read_u16(bs);
                location_entry->extent_entries = gf_list_new();
                for (j = 0; j < extent_count; j++) {
-                       GF_ItemExtentEntry *extent_entry = (GF_ItemExtentEntry *)gf_malloc(sizeof(GF_ItemExtentEntry));
+                       GF_ItemExtentEntry *extent_entry;
+                       GF_SAFEALLOC(extent_entry, GF_ItemExtentEntry);
                        if (!extent_entry) return GF_OUT_OF_MEM;
                        
                        gf_list_add(location_entry->extent_entries, extent_entry);