From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 434A547076 for ; Thu, 27 Jul 2023 00:19:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DB44D68C993; Thu, 27 Jul 2023 03:19:15 +0300 (EEST) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 63DBC68C8FC for ; Thu, 27 Jul 2023 03:19:10 +0300 (EEST) Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6bb2ce4f9f8so313928a34.3 for ; Wed, 26 Jul 2023 17:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690417148; x=1691021948; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=CgygAHxWALVOz2fvSsrmmGpluKBgd3PIFzvKkHrZKDs=; b=d+Nc4N/r1Twl6GrpK7RNGwCzI3yJX+dGXLrhuA3h81LEOLJo9R5KJ6CzPgxrv+9tJA 3Z6d4uTMn8NrhIIxX2rU2QAZuFL9luK9HOWyTvZIZBtxREm8NzT5K1nvV69MfPVW2IMR WMnixhIOKF0PB/7KpJBnaBoITeOeU4E6dEA1CrH3XYCuuRI3BqxgowQ/zjD7Q4mWJH3w LvMce3968zj5BuQQA8IaBVuuqHVC2h3zur4KqYtILCIuipgQX8ZGtm1LpaxwzG4ebpsq TDnYOIfmV1Fe3fboUFKbc6aJXF0Lc9x23Cz7QUj3lpm3zxc4ixgqCPeupseaLoerHeE4 wBgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690417148; x=1691021948; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CgygAHxWALVOz2fvSsrmmGpluKBgd3PIFzvKkHrZKDs=; b=erEQYnjRZbkSr8plMpVlBNLx6o6YloGBREYYI/jewcPrn5cluk7i+yRG3gvN+YuQ5Y napwr7BGdHfOj76qkfwbXc9XaiZpiR5C7YAbwWnp2U/M20Q0zu1MnbQkLvomJ4jZY9Tg L9frA9bvHTfmyck9PUGl5UdEkVoIlVK6m5I5RPaThk0669G/Gk9YwPMIq94z68GLmcOO o12XX2QTQ793h8XVH2NBK3Yt93BxTYcITFpyHsSkS1BYZSsySFWdTPpVtb6H8mD4Vnhv t3UXV4vIQB8Zi2Mv5jUaGOw/m9Kdczuy+g1mGrEk8BDLDjjuD9vpQiXYS4Lh3h+USzK8 wBRQ== X-Gm-Message-State: ABy/qLYEAXFnPf0E4mLowOvN//xUv4AujiSKCZn1nLbgRiPkUHA6kM1Y eCWseShDgPOcQYlGLib8cFRDr+Hlb5w= X-Google-Smtp-Source: APBJJlEXLXyayQSaUy60L77ghS4X6fjzwOMjxo70bCw+G95IYAjiwX2jZnv9QrEgPxVd8rrPTQ4oSw== X-Received: by 2002:a05:6830:1112:b0:6b9:4b45:430a with SMTP id w18-20020a056830111200b006b94b45430amr3892678otq.19.1690417148381; Wed, 26 Jul 2023 17:19:08 -0700 (PDT) Received: from [192.168.0.16] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id v18-20020a9d5a12000000b006b8c277be12sm201356oth.8.2023.07.26.17.19.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jul 2023 17:19:08 -0700 (PDT) Message-ID: Date: Wed, 26 Jul 2023 21:19:10 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230726235916.30058-1-michael@niedermayer.cc> <20230726235916.30058-4-michael@niedermayer.cc> From: James Almer In-Reply-To: <20230726235916.30058-4-michael@niedermayer.cc> Subject: Re: [FFmpeg-devel] [PATCH 4/4] avcodec/evc_ps: Check num_ref_pic_list_in_sps X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 7/26/2023 8:59 PM, Michael Niedermayer wrote: > Fixes: out of array write > Fixes: 60798/clusterfuzz-testcase-minimized-ffmpeg_BSF_EVC_FRAME_MERGE_fuzzer-4633529766772736 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/evc_ps.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/libavcodec/evc_ps.c b/libavcodec/evc_ps.c > index 04ee6a45e6..64384a392c 100644 > --- a/libavcodec/evc_ps.c > +++ b/libavcodec/evc_ps.c > @@ -243,11 +243,20 @@ int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps) > sps->rpl1_same_as_rpl0_flag = get_bits1(gb); > sps->num_ref_pic_list_in_sps[0] = get_ue_golomb(gb); > > + if ((unsigned)sps->num_ref_pic_list_in_sps[0] >= EVC_MAX_NUM_RPLS) { EVC_MAX_NUM_RPLS should be 64, not 32 as it's currently defined. So change that too and it LGTM. > + ret = AVERROR_INVALIDDATA; > + goto fail; > + } > + > for (int i = 0; i < sps->num_ref_pic_list_in_sps[0]; ++i) > ref_pic_list_struct(gb, &sps->rpls[0][i]); > > if (!sps->rpl1_same_as_rpl0_flag) { > sps->num_ref_pic_list_in_sps[1] = get_ue_golomb(gb); > + if ((unsigned)sps->num_ref_pic_list_in_sps[1] >= EVC_MAX_NUM_RPLS) { > + ret = AVERROR_INVALIDDATA; > + goto fail; > + } > for (int i = 0; i < sps->num_ref_pic_list_in_sps[1]; ++i) > ref_pic_list_struct(gb, &sps->rpls[1][i]); > } _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".