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 22D6E436BD for ; Tue, 20 Sep 2022 21:53:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C37D168B9CB; Wed, 21 Sep 2022 00:53:04 +0300 (EEST) Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DF54A68B726 for ; Wed, 21 Sep 2022 00:52:58 +0300 (EEST) Received: by mail-yb1-f173.google.com with SMTP id 63so5402596ybq.4 for ; Tue, 20 Sep 2022 14:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date; bh=39TVj/gJFqPle7ssYbTWbnEC3cM3W6L86L3/jwSLZ2g=; b=QZhp5u4Xd/CDSutJVnCF58BphDRPOunVPlwUnLYGNxz/BceW9KuYOS4TzWz8mkc3Ld La8zso4xa+kQDZfMENPYcemZnIItTYAejnxv7KXNtd/TZdnmhHJfyoEEAsn/8DbN0HW4 er1c2OOKIay5DBl68Xz9zxvYn0qGMGXkIKO4k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=39TVj/gJFqPle7ssYbTWbnEC3cM3W6L86L3/jwSLZ2g=; b=wCPQ/sIN6dZndm04mzjm9ZIKubBpTK3eVkTmpFQ3aNRWobwC+WQYzAOFduXdytPUV+ ZiHOS6om0gVv9HVa8ZovhhrX8qsNOTFNplEPetKL3G3IyyZKHpYOVFPRuYBpVA7BO/lP 06W6LjnDx/QVbi6Wvf7GzB5eOJexi5/Eax8l6cT9mEWHIQuunE9vLrTCJqolW5kWEvx2 4+bCT4wrlMATHlJAhRuloeW0q1gmzuGSLld947Nru8wmbtz1XsMvgwSpCZnHXBiJB1TQ Wumz4dYH0LmZ3p/fYwfhG2Ry8inXG/rZq/LaegAmrSMcduK1eyIahOAj3H1ilHTzwWx0 t6NQ== X-Gm-Message-State: ACrzQf1CGhwjXGmHRRfC7RwhtJzA5l5CiPQLfjbb395uzvqePuHAA1rN yQtuxdpqmfchD/AAgnx6toAdSe+dy2Q6kZa0OxCL96RtdR8= X-Google-Smtp-Source: AMsMyM79nDwEDeovGIWS+2USX7Yy641JbZ34PRcPjbmgNeYa70Grm9CFZ/brzVbtGW20vtPvTnTD4JVVGqloPvHoSYE= X-Received: by 2002:a05:6902:45:b0:6ae:ce15:a08d with SMTP id m5-20020a056902004500b006aece15a08dmr20949744ybh.380.1663710777072; Tue, 20 Sep 2022 14:52:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Will Cassella Date: Tue, 20 Sep 2022 14:52:46 -0700 Message-ID: To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH] libavformat/riffec: Zero-initialize `channels` in `ff_get_wav_header` 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Pinging on this! On Fri, Sep 9, 2022 at 3:50 PM Will Cassella wrote: > > Clang's static analyzer complains that leaving the `channels` variable > uninitialized could lead to a code path where the uninitialized value is > written to `par->ch_layout.nb_channels` at the end of this function. > This patch simply zero-initializes that variable to avoid that. > > Signed-off-by: Will Cassella > --- > libavformat/riffdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c > index 3946ecb72f..fc75500d1f 100644 > --- a/libavformat/riffdec.c > +++ b/libavformat/riffdec.c > @@ -94,7 +94,7 @@ static void parse_waveformatex(AVFormatContext *s, > AVIOContext *pb, AVCodecParam > int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, > AVCodecParameters *par, int size, int big_endian) > { > - int id, channels; > + int id, channels = 0; > uint64_t bitrate = 0; > > if (size < 14) { > -- > 2.37.2.789.g6183377224-goog _______________________________________________ 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".