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 3DA8E446A7 for ; Tue, 20 Sep 2022 22:00:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B158B68BA02; Wed, 21 Sep 2022 01:00:36 +0300 (EEST) Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DFFA068B612 for ; Wed, 21 Sep 2022 01:00:29 +0300 (EEST) Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-12803ac8113so6347126fac.8 for ; Tue, 20 Sep 2022 15:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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; bh=g4L58B7jhg6IN0dBRw100JxKCIlEiKsCR/ff8/CcgRo=; b=BpP1xShjOUh2F9jqGUUK7zJ0qaGmqh3rzvlnrUrjY47L+5tgOMAJJ1BK8UftJCRfAw 0eCZfK2/Yuo0sXS5FOSkCTzRXZDyxovNZRH0KqYqeRMmSYmRJwBTOCapk3ym5z4FkR33 KPDp27uSdFlwac7Ot1zmEyNooBcoNTucnQcgdnw2+n7pnjEo4EWurF6jWBYNFNc1AtLc iB3MzFOP8pPmpFi5r66A3/PTZp8lUK+a3NudsGYuIvuJVtUsH1TUBm/jn+VVjH1my5OJ yMLcCXeqGmAtict/CAEYDLk3KMlOhMU/bZHk0mQQJBCx8SCm3j0o6pkI6kzgOMcF03H2 TE4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=g4L58B7jhg6IN0dBRw100JxKCIlEiKsCR/ff8/CcgRo=; b=5QcqF6p9+umYIvT26p2CjotCQ00nDnr7dKytsdPCUfZHNPXrWH1APTlUSWio6425Vn lz9o93XfZ3lK7OV8BKCn/ZS1rDZvZRVLJ1jJLo7VVUYmcMOXl6tn3McgRUKNbl6X7SnB it9WOTkcjkt7kT6R+PkH4ioeH7Ry1CLo+R3oFIZp1TdB6rFKNxHypH1o6zVIDOix8eIC q7Wk0XwVvK485nEros8VfATNRLOKkXdIq9hKamNtPKTpGOetWJBwyAoK1ZfA/KwqGP2m SbEAFnCTmNiJLyRCYXbzU1DTrqOK9CxIWIG05kDEdPdWV+TI1UDQYOTAo46+JDeim+zo pIug== X-Gm-Message-State: ACrzQf25gKdrQeNnnrHw9S2heS9jcicjUtAhV0+uzgpiSL4phYTKX1kh e19yKB/Fi7ijEZULOQeBFdNljR5Uki0= X-Google-Smtp-Source: AMsMyM4/JxWVHOTalQbKIquXw/PaZoPkqwjNu3nZ1muihHfEQEzqqax/e2z27sJCoPrUDwA9N/6o9A== X-Received: by 2002:a05:6870:231c:b0:116:de05:d4fb with SMTP id w28-20020a056870231c00b00116de05d4fbmr3426982oao.231.1663711227753; Tue, 20 Sep 2022 15:00:27 -0700 (PDT) Received: from [192.168.0.13] ([191.97.187.183]) by smtp.gmail.com with ESMTPSA id f5-20020a056830204500b006391adb6034sm414279otp.72.2022.09.20.15.00.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Sep 2022 15:00:27 -0700 (PDT) Message-ID: Date: Tue, 20 Sep 2022 19:00:25 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: From: James Almer In-Reply-To: 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-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 9/9/2022 7: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) { Applied, thanks. _______________________________________________ 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".