[PATCH] fixed #2008
authorjeanlf <jeanlf@gpac.io>
Mon, 3 Jan 2022 10:24:15 +0000 (11:24 +0100)
committerMoritz Mühlenhoff <jmm@debian.org>
Mon, 19 Jun 2023 21:46:06 +0000 (22:46 +0100)
Gbp-Pq: Name CVE-2021-46047.patch

src/media_tools/isom_hinter.c

index f423480babfdf6b16954a21f9ebce598fe627a37..0863a744d3b1223be552bf6573e31304afde23d5 100644 (file)
@@ -1265,10 +1265,13 @@ GF_Err gf_hinter_finalize(GF_ISOFile *file, GF_SDP_IODProfile IOD_Profile, u32 b
                        }
                        gf_isom_sample_del(&samp);
                }
-               if (remove_ocr) esd->OCRESID = 0;
-               else if (esd->OCRESID == esd->ESID) esd->OCRESID = 0;
 
-               gf_list_add(iod->ESDescriptors, esd);
+               if (esd) {
+                       if (remove_ocr) esd->OCRESID = 0;
+                       else if (esd->OCRESID == esd->ESID) esd->OCRESID = 0;
+
+                       gf_list_add(iod->ESDescriptors, esd);
+               }
 
                if (is_ok) {
                        u32 has_a, has_v, has_i_a, has_i_v;