From patchwork Wed Oct 18 00:49:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 44286 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3e0b:b0:15d:8365:d4b8 with SMTP id bk11csp743273pzc; Tue, 17 Oct 2023 17:49:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/IO35c12aQlMnTc7EzM2VxAHKHRpYRO/44r5aGdruKEvc0PfZAz4hb1wd68ETuaPIgIWM X-Received: by 2002:a19:6703:0:b0:507:a229:f53e with SMTP id b3-20020a196703000000b00507a229f53emr2541535lfc.24.1697590196523; Tue, 17 Oct 2023 17:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697590196; cv=none; d=google.com; s=arc-20160816; b=vtV3GOhKOdoNR4lQCVfuNnCZnB3Kw8OQ0kxcmsBO/9UkrGLMiMf5rW8OvPqA5gyhrK 22iUVZ0Rcl3aOvQM2yh+pnLxy62xC06k99PEzQqWCTQCB+amoZC/OsrOnjDeSG4sp6Te CvczjwnIIE52x5NmXbY2COMx0JxuM1E0EVmOIsPvgFeFFyhTIvCfVsLYNykTG00E80Po AI0F6pK+jDiksi1DLNsFSD456kM7is3a+DdRF0GAqx3d/fujdL5CnEGGvnyA7tbAvMDq XGsBSNJpoMaI9NiLTZVbE0C2bCmhuSmNu2uEKBqCzFltTmKbwmspDUDn5boFzzSkQYHi +q/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=SipUB345hamnDltiyNNs+B+KXI5F997oi8/dtZvdmPw=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=dAI+aZnWMnhtlUkhFGk62hI4iDuSLIow9XpVlWxFZxn1LOGm8NslTnu1uXvyvCalFZ K6+0/xF1vplSYwwSZBoZi6MKPIY/Fsdco9CzJeUB42842yr00P10p4PhAd7QKbGtolgl BuzyLIlqZfyMgQRsiJOwpYj2bQ4A+X2bN47skCmfxdP9GnIY982ZSGWHSsgrrP0C1YSP tX+RgaTy9PXm1/QBHoUThJNKSrSGyxj0OhF80DxrwLlxA5XbUedn+4+rwwHaWGm5Cmo7 M5hTiVdYMrkSubdLCHh89927uQs1FozlqZ72GB7ZwvEvFmPpZfyrb42IxroTZ6uHsZp9 uJzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d19-20020aa7ce13000000b005381520ddc3si1241686edv.418.2023.10.17.17.49.55; Tue, 17 Oct 2023 17:49:56 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CF61968CA20; Wed, 18 Oct 2023 03:49:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E426A68CA0F for ; Wed, 18 Oct 2023 03:49:37 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2714540002 for ; Wed, 18 Oct 2023 00:49:36 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 18 Oct 2023 02:49:35 +0200 Message-Id: <20231018004935.18309-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231018004935.18309-1-michael@niedermayer.cc> References: <20231018004935.18309-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/hevc_ps: Dont leave invalid cpb_cnt_minus1 in the context 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: R5CHB+wctStY Fixes: index 32 out of bounds for type 'uint32_t [32]' Fixes: 63003/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4685160840560640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/hevc_ps.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index a6b64b92e3..f4365ef5b5 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -421,6 +421,7 @@ static int decode_hrd(GetBitContext *gb, int common_inf_present, if (hdr->cpb_cnt_minus1[i] > 31) { av_log(NULL, AV_LOG_ERROR, "nb_cpb %d invalid\n", hdr->cpb_cnt_minus1[i]); + hdr->cpb_cnt_minus1[i] = 0; return AVERROR_INVALIDDATA; } }