From patchwork Sun Jul 28 10:25:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 50794 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:16f:b0:489:2eb3:e4c4 with SMTP id h47csp589011vqi; Sun, 28 Jul 2024 03:52:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUQAPwrewMs5cAwwUysasma+ylecoYvkJTGngZHBjKJFRuZCUPvEfRb4scwbFZeDo5MscV20T8Feek13qWWXBBUGLK+N1pt4jaqhw== X-Google-Smtp-Source: AGHT+IFKv67aO4px1ACUmHwwHKtxz8EFponi4Sc4tWDmnIl85MRh58NEAt1O8QGEDXbaucfL06LG X-Received: by 2002:a05:6512:3b8b:b0:52c:d904:d26e with SMTP id 2adb3069b0e04-5309b27a307mr3452499e87.21.1722163925867; Sun, 28 Jul 2024 03:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722163925; cv=none; d=google.com; s=arc-20160816; b=qMt3rw3pDABsGUqRuLCU+hFRKodRMltDRPeVVTTQ1aayVYBdV5dBKIz/IoTvQ1O4FF BxLHv9C9WXjCpTQbNg+4CTO8MkaXFhh/00F14JQlNU2d68UgRT2gSJYJZklmK/ToepkM nNGexp71FA2xII1DVi8opN2ajC4NY1wwf3s6YbdwdFbVO1SrR02xTK1k7NfPKJbTnQuq UDQ2wc1LhHJRv97JTnRpxdIYpGvqfePEWkVOSv+CxAfjokhQ5+ZiHX0bjz78G0ojriRB RnQKJayCdAR0c9+6OA6FcZ+X+3H7b6Z/ti2/birkdP2/g09I5iBWwjbUaKiG9Vwno4pA mjVA== 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=ZOHc1y/hy0DZvZfQsV42ABQ8nz0eE9r/2UxDgPj4x00=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=QS+6vU0ygVMmlNaViqcsBR3cUJd+cqXcsi4ZuUzCglN4l/LiRcIvstEx5axgOFWW2H TEP87+ivY/2QczJhV0lgTR8TXFxYZ9ylTKYFa9MQ7xcSA0VMgQOiNCKUL2Y6VWM7rqeJ uhOPAiyAVyYeA2shi+x5JczzNauFIwdrt3GTLpN9QNMhZ0NMUQYK6ftf3VFJnu+79dvd 5ETo/pzOb1Bkyr+dWKenf2i8qKczDZxW8AnarRJsa8va/DTC2Xxs2Il9/HKiN5gAH2HA kn6X77sqZxUMI5ZJmjO+O+7+LdRET2wBO8+zq3JvzSPbXWqv3f7PlQCA8taKCvj2LKE+ 6j0w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=AoeAGlIz; 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 2adb3069b0e04-52fd5b9d107si2239142e87.159.2024.07.28.03.52.05; Sun, 28 Jul 2024 03:52:05 -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=@haasn.xyz header.s=mail header.b=AoeAGlIz; 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 6A91768D7A1; Sun, 28 Jul 2024 13:25:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CF89E68D866 for ; Sun, 28 Jul 2024 13:25:41 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1722162338; bh=0Fyc8RtjPmbKBjckBo6URpCvxaKZ3rgc8TbiMiTitJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AoeAGlIzcBZjYOOdMQdBn//hBytTitf4g9lYsrq1Nru+xJRm1MOm9+kHuuzmZXH/Y vnO6/2C6rulNd2TsBrmRgfOnB6OVUoD7D0pt28ja2cgrIyGkHi86gt0jTB5UDKDlB9 Mm7th/+fkKlFTLnUh5D1YyfA88SK4LDuxm/No8UE= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id DD6EE43521; Sun, 28 Jul 2024 12:25:38 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sun, 28 Jul 2024 12:25:22 +0200 Message-ID: <20240728102527.17991-17-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240728102527.17991-1-ffmpeg@haasn.xyz> References: <20240728102527.17991-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 17/22] avcodec/dovi_rpudec: sanitize DM data before decoding 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: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: osVzHIxVJWX1 From: Niklas Haas Some DM types do not fill the whole struct, so just clear it entirely before going filling the decoded values. --- libavcodec/dovi_rpudec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/dovi_rpudec.c b/libavcodec/dovi_rpudec.c index 91c9e41926..9f295d4fe4 100644 --- a/libavcodec/dovi_rpudec.c +++ b/libavcodec/dovi_rpudec.c @@ -323,6 +323,7 @@ static int parse_ext_blocks(DOVIContext *s, GetBitContext *gb, int ver, dm = &ext->dm_dynamic[ext->num_dynamic++]; } + memset(dm, 0, sizeof(*dm)); dm->level = level; switch (ver) { case 1: ret = parse_ext_v1(s, gb, dm); break;