[PATCH] fixed #1898
authorjeanlf <jeanlf@gpac.io>
Mon, 30 Aug 2021 15:09:02 +0000 (17:09 +0200)
committerAron Xu <aron@debian.org>
Tue, 23 May 2023 11:53:25 +0000 (12:53 +0100)
Gbp-Pq: Name CVE-2021-40564.patch

src/media_tools/av_parsers.c

index 6fb3d6f8d517eabf65f70fcaeaf10a9358bd2081..a0330c630b7b465a7edb97b06c3e62f43fddcc8c 100644 (file)
@@ -5559,7 +5559,7 @@ static s32 avc_parse_slice(GF_BitStream *bs, AVCState *avc, Bool svc_idr_flag, A
        if (si->slice_type > 9) return -1;
 
        pps_id = gf_bs_get_ue(bs);
-       if (pps_id > 255) return -1;
+       if ((pps_id < 0) || (pps_id > 255)) return -1;
        si->pps = &avc->pps[pps_id];
        if (!si->pps->slice_group_count) return -2;
        si->sps = &avc->sps[si->pps->sps_id];