[PATCH] fixed #1786 (fuzz)
authorjeanlf <jeanlf@gpac.io>
Mon, 10 May 2021 09:31:19 +0000 (11:31 +0200)
committerMoritz Mühlenhoff <jmm@debian.org>
Mon, 19 Jun 2023 21:46:06 +0000 (22:46 +0100)
Gbp-Pq: Name CVE-2021-33363.patch

src/isomedia/box_code_meta.c

index 6c571c456edb00e21f16032582caaf9913a613fb..cdec9cfbdaef7886d19472a5f5d381a898d35bd9 100644 (file)
@@ -568,10 +568,13 @@ GF_Err infe_box_read(GF_Box *s, GF_BitStream *bs)
                                ptr->content_type = (char*)gf_malloc(sizeof(char)*string_len);
                                if (!ptr->content_type) return GF_OUT_OF_MEM;
                                memcpy(ptr->content_type, buf+string_start, string_len);
-                       } else {
+                       } else if (!ptr->content_encoding) {
                                ptr->content_encoding = (char*)gf_malloc(sizeof(char)*string_len);
                                if (!ptr->content_encoding) return GF_OUT_OF_MEM;
                                memcpy(ptr->content_encoding, buf+string_start, string_len);
+                       } else {
+                               //we could throw an error but we silently accept this infe
+                               break;
                        }
                        string_start += string_len;
                        string_len = 0;