[PATCH] fixed #1736
authorjeanlf <jeanlf@gpac.io>
Thu, 8 Apr 2021 08:21:26 +0000 (10:21 +0200)
committerSebastian Ramacher <sramacher@debian.org>
Wed, 1 Sep 2021 19:50:08 +0000 (20:50 +0100)
Gbp-Pq: Name CVE-2021-31260.patch

src/isomedia/track.c

index 10f6af76d8e2ff5b43636090634a8607a8a418e9..50ce87a0647049284a1eb0348dbc44e7ffd4e3a7 100644 (file)
@@ -1003,10 +1003,13 @@ GF_Err MergeTrack(GF_TrackBox *trak, GF_TrackFragmentBox *traf, GF_MovieFragment
                                if ((aux_info_type == GF_ISOM_CENC_SCHEME) || (aux_info_type == GF_ISOM_CBC_SCHEME) ||
                                        (aux_info_type == GF_ISOM_CENS_SCHEME) || (aux_info_type == GF_ISOM_CBCS_SCHEME) ||
                                        (gf_list_count(traf->sai_offsets) == 1)) {
-                                       offset = saio->offsets[0] + moof_offset;
-                                       nb_saio = saio->entry_count;
-                                       break;
+                                       if (saio->offsets && saio->entry_count) {
+                                               offset = saio->offsets[0] + moof_offset;
+                                               nb_saio = saio->entry_count;
+                                               break;
+                                       }
                                }
+                               saio = NULL;
                        }
                        for (i = 0; i < gf_list_count(traf->sai_sizes); i++) {
                                saiz = (GF_SampleAuxiliaryInfoSizeBox *)gf_list_get(traf->sai_sizes, i);
@@ -1018,6 +1021,7 @@ GF_Err MergeTrack(GF_TrackBox *trak, GF_TrackFragmentBox *traf, GF_MovieFragment
                                        (gf_list_count(traf->sai_sizes) == 1)) {
                                        break;
                                }
+                               saiz = NULL;
                        }
                        if (saiz && saio && senc) {
                                for (i = 0; i < saiz->sample_count; i++) {