From patchwork Sat Jun 4 10:35:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martijn van Beurden X-Patchwork-Id: 36069 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp5125332pzj; Sat, 4 Jun 2022 03:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+HUqvA9J04K0w7ra9J19WP8kdowYbqFSaFzl9g8ZZihkw38MZEPLjnI3ROGbf6KhXbITh X-Received: by 2002:a17:907:c202:b0:710:8d0c:6e89 with SMTP id ti2-20020a170907c20200b007108d0c6e89mr2503260ejc.141.1654338958057; Sat, 04 Jun 2022 03:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654338958; cv=none; d=google.com; s=arc-20160816; b=wEFzBFhrijlvbcbBA5bIJq6c25rv2BXNF91Kucn4qm0gdX9JPIK/ve+yBRDwmCsYOP A6HiiE/gBekU2d70RdDLBx498y6QUHWuTs1KMtEB/RfUxBAsvmEqjp8Q52hQNhCfQ8Vd jmV3aCKjYPw5ToB7j7PnkBvAiSHFDwlksugFVD7PqAuCx0qe/eDZ7iPFlhF1E2lIZcpJ qx+OzAjZVyqrZ4ZmsPVyvR+i1U9/UwaLamkTjC/Hc8wQH7pdXuORMeyNUvGCz+pDIdqd Q2tT/xy1Y14Kq1vm0VUzYQiH5R1IhfhDZ4YB0ZEz+ydtr7qnTG5HXctS5bCjAmX8tDpC aJAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=s/aBSjXFiLDu+kh3a92PUGqTISKgsf+9lv96WlmJXfU=; b=sEiNnRBFsAXrXoVXMMPhulCTWpIRjw993QUmyxF/1+Dwbz9qhMG19DrmMSeMfqHHK1 PXVwRanKDGf6JZbzYRNidaPtj9V0Irl5zheOjdKE99qND80jFaMiO1HDo98VRuoHzfwO F+5BEYx9CB8ERryZWNNqVQO672KCZDYxhE6kItCePASKjHodQdGPZ1Iw+IeFOsuREHzu 8Y8Rr+uV8e7BY5tzXhYImrQWzSXkvcQ7g20jmN2NzFMYBYAU7hfa5dFdzsMo9scFi1HS l6wS14YxNr+gatFxsw24k5tsIFzWXBOTKorBuLJIE+z6G8wfAkGLDMuuLa3C7MdRSAh0 di7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=i6KMZYDv; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g14-20020a056402090e00b0043137319d67si390879edz.324.2022.06.04.03.35.57; Sat, 04 Jun 2022 03:35:58 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=i6KMZYDv; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C9DDC68B757; Sat, 4 Jun 2022 13:35:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 59A6468B58F for ; Sat, 4 Jun 2022 13:35:39 +0300 (EEST) Received: by mail-ej1-f54.google.com with SMTP id h23so9189391ejj.12 for ; Sat, 04 Jun 2022 03:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SNyk9CHuGP3MtbxzoY5/flDxd9gdD3osHzenTFRYAuo=; b=i6KMZYDv3Po1w7YaWyja0qNFTvkkG4E9vvLM7nbkIRIbdSCwjf+uY6fl4aRS2XDnH1 POWSUm6lmsh3KmIqBW8TO9sKLAE0HzrsutUJq/ns2af9y0IRIBlI+tFDBkUDve9fodHL 95W8FTMLs2Jl4WYvlVLfaGWYvY75AfFB3ewmK6BSTBXgGpB9CCyxVW6Bdy3BUTM1Xr5r uxA+41dnoxhGrxfBXMKf4N1uQbn4ZoDT3Oo7Hg9g8kg4rD1cA1ZsUv+EAIXigBhjrGI1 4C3T1+RwUPa4v05VKeoovAx1Dhzx5dIAG8W6zNpyYp9DffTRfLXh5jIBfVkDPzmHZSPl Rwqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SNyk9CHuGP3MtbxzoY5/flDxd9gdD3osHzenTFRYAuo=; b=oZQ3Q2mxdXx5qBym15GLRAom5reMB9ROJJ7ELm84Ea1hQuCmWDHuqajzfB6v250HSn VfPxZZ12VeZOV7Amby0+isDpL1VMNmrdeBEArbCBVcveASgqhdJUZ61yPbRL46vL7/qt 4bQD3tocJ+HPy7w8lbcKvHFskd1RN+WLKXbvn+WfoSLbuQ8xWcGdAPSJHh7RQ9yLFojl lDo1WtBuWdG0euVr3eEunopm9bYrEdo8evV8h9KkXXzy4f2uUrZav5QbzFHmx+tVqcLy Q0PSTx9wwFlP2aJqyXRQrv1QPvHG4cDSo9MivgpV14uOD0dXCy4ZOWtwkoAbPUQ8BO9d p6NQ== X-Gm-Message-State: AOAM531F+Weq1XFGmJ3t2p19hGMRMArXlnvWMPVW4kTmH+OV4I++jQjR rR/dCAHmZ8LQ9tgWYHOKKIuDz7IinAx+lg== X-Received: by 2002:a17:907:e9f:b0:6ff:3a0:cdfd with SMTP id ho31-20020a1709070e9f00b006ff03a0cdfdmr12961565ejc.448.1654338938527; Sat, 04 Jun 2022 03:35:38 -0700 (PDT) Received: from localhost.localdomain (92-64-99-37.biz.kpn.net. [92.64.99.37]) by smtp.googlemail.com with ESMTPSA id h1-20020a170906590100b006fe97996423sm3793743ejq.219.2022.06.04.03.35.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jun 2022 03:35:38 -0700 (PDT) From: Martijn van Beurden To: ffmpeg-devel@ffmpeg.org Date: Sat, 4 Jun 2022 12:35:07 +0200 Message-Id: <20220604103507.1822192-2-mvanb1@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220604103507.1822192-1-mvanb1@gmail.com> References: <20220604103507.1822192-1-mvanb1@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 2/2] avformat/mov: prevent potential use of uninitialized value 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 Cc: Martijn van Beurden Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: r3YwzdX/DGJd --- libavformat/mov.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index d7be593a86..f3a63abaaa 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -6772,7 +6772,10 @@ static int mov_read_dfla(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); /* Flags */ - avio_read(pb, buf, sizeof(buf)); + if (avio_read(pb, buf, sizeof(buf)) != sizeof(buf)) { + av_log(c->fc, AV_LOG_ERROR, "failed to read FLAC metadata block header\n"); + return AVERROR_INVALIDDATA; + } flac_parse_block_header(buf, &last, &type, &size); if (type != FLAC_METADATA_TYPE_STREAMINFO || size != FLAC_STREAMINFO_SIZE) {