[PATCH] av1: flush samples on parse error (#2387)
authorAurelien David <aurelien.david@telecom-paristech.fr>
Fri, 10 Feb 2023 14:36:49 +0000 (15:36 +0100)
committerMoritz Mühlenhoff <jmm@debian.org>
Mon, 19 Jun 2023 21:46:06 +0000 (22:46 +0100)
Gbp-Pq: Name CVE-2023-1449.patch

src/filters/reframe_av1.c

index 67eaa743ce28036bb1a75f1858e8a663fd517284..be7d86c6bce93ae21600b5ad2debdf9d51778972 100644 (file)
@@ -720,7 +720,7 @@ static GF_Err av1dmx_parse_flush_sample(GF_Filter *filter, GF_AV1DmxCtx *ctx)
 
        if (!ctx->opid)
                return GF_NON_COMPLIANT_BITSTREAM;
-               
+
        gf_bs_get_content_no_truncate(ctx->state.bs, &ctx->state.frame_obus, &pck_size, &ctx->state.frame_obus_alloc);
 
        if (!pck_size) {
@@ -804,7 +804,12 @@ GF_Err av1dmx_parse_av1(GF_Filter *filter, GF_AV1DmxCtx *ctx)
        //check pid state
        av1dmx_check_pid(filter, ctx);
 
-       if (e) return e;
+       if (e) {
+               if (e!=GF_EOS && e!=GF_BUFFER_TOO_SMALL) {
+                       av1dmx_parse_flush_sample(filter, ctx);
+               }
+               return e;
+       }
 
 
        if (!ctx->opid) {
@@ -1114,4 +1119,3 @@ const GF_FilterRegister *av1dmx_register(GF_FilterSession *session)
        return NULL;
 }
 #endif // GPAC_DISABLE_AV_PARSERS
-