From: Dirk Farin Date: Tue, 5 Apr 2022 16:41:28 +0000 (+0200) Subject: [PATCH] fix streams where SPS image size changes without refreshing PPS (#299) X-Git-Tag: archive/raspbian/1.0.3-1+rpi1+deb10u3^2~11 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=55fb165e139d57438eea8f1657cd9c5237156663;p=libde265.git [PATCH] fix streams where SPS image size changes without refreshing PPS (#299) Gbp-Pq: Name CVE-2021-36408.patch --- diff --git a/libde265/decctx.cc b/libde265/decctx.cc index edebb71..6701725 100644 --- a/libde265/decctx.cc +++ b/libde265/decctx.cc @@ -562,6 +562,15 @@ de265_error decoder_context::read_sps_NAL(bitreader& reader) sps[ new_sps->seq_parameter_set_id ] = new_sps; + // Remove the all PPS that referenced the old SPS because parameters may have changed and we do not want to + // get the SPS and PPS parameters (e.g. image size) out of sync. + + for (auto& p : pps) { + if (p && p->seq_parameter_set_id == new_sps->seq_parameter_set_id) { + p = nullptr; + } + } + return DE265_OK; }