[PATCH] fixed #1661
authorjeanlf <jeanlf@gpac.io>
Mon, 4 Jan 2021 10:18:27 +0000 (11:18 +0100)
committerMoritz Mühlenhoff <jmm@debian.org>
Mon, 19 Jun 2023 21:46:06 +0000 (22:46 +0100)
Gbp-Pq: Name CVE-2020-35980.patch

src/isomedia/isom_store.c

index 80a6b5c87469188557ea94eb52551477d6619100..7c4ce0584a543f4b006d0c5530757e9c278ae720 100644 (file)
@@ -102,6 +102,9 @@ void CleanWriters(GF_List *writers)
 {
        while (gf_list_count(writers)) {
                TrackWriter *writer = (TrackWriter*)gf_list_get(writers, 0);
+               //in case we have an error in the middle of file write, remove our created stco and stsc from sample table
+               gf_list_del_item(writer->stbl->child_boxes, writer->stco);
+               gf_list_del_item(writer->stbl->child_boxes, writer->stsc);
                gf_isom_box_del(writer->stco);
                gf_isom_box_del((GF_Box *)writer->stsc);
                gf_free(writer);