From patchwork Sat Aug 31 20:45:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Scholz X-Patchwork-Id: 51264 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4027:b0:48e:c0f8:d0de with SMTP id ky39csp1092514vqb; Sat, 31 Aug 2024 13:55:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWf7mC74TbxbbAzl333r1zRVxt/bNSzDjZ4EQ7PYX0leOAdc4tZSjqhBauEj10+pslrFB2iHBJpNMM6lX8WFEL3@gmail.com X-Google-Smtp-Source: AGHT+IGZu7sg0DQD8zlbB2DezHOoCvoRaEzomsh46wVxs5kIenTDB4zu57ZUw85ImbYm5rRHIRLO X-Received: by 2002:a2e:a987:0:b0:2ef:2b6e:f8c2 with SMTP id 38308e7fff4ca-2f61e09c1e0mr21883921fa.6.1725137712603; Sat, 31 Aug 2024 13:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725137712; cv=none; d=google.com; s=arc-20240605; b=kVVz4bugQmqU9beIyw5mkP4cgHJak6PgBDA5pS1FNDc5cGR9iiyj+IA0io/vFxUbjk da0Yg5hwnUxtgI3EVPaZXYsLDxctLrgzfjHIgqXg36oSr+7bwHFPz/R6BUDsQJwIGk/c xFc6yZxRhmz0f3TriB0ni2OhpokeoLiZ+xXZmA+10mCNJUufyHRyZ+5PN7JNQoHyQ9ea nPUxEVc7GIz0V5nkY25NNdhg7Vh4mbemVVqE+BhO/w8OBAo+lET4BwZh4OPMoV0fSeGs 80phfvJzNjAUOmg1gRj/7D2Y9k9j1ENyy4oPEIUYaB/MN3lzVkcZFzvqS1tyXYDdD+fM RPPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:date:from:to:message-id:dkim-signature :delivered-to; bh=bDfDw/jPJ8AgxRRu7ND4NNRy/bvnLyt5dhBFTgpEnYQ=; fh=5IeVwzS1vbVKjIV8MP3mnmnRtZGb8uteQ9r4QD2keV0=; b=g3SNQOjzQ7lfXTp2IktP8V/JCPKgZrbLFCkExxzTIVjosjuCnWcmcJeLryqQsI9TVc 5oapLq9Ia0K8p8KYiPwnSnL8pOEa0Ol78A0uVMcpHkSsNTXP4usIPJtNy+01Nh2hU7+Q tg81gskRFJTP6owDvvKtlUpWrl5Sj9SHqmmmALqIYHpU36DT6HE4I4tYmdfBZgC8Cxj7 wVVCG7bNZXYQVKYyRLNX1puHM3vgaDoEyMzId7aOpNMfqwUAHXVtXBfos7r3kAYY0xdd N3PtXffPdhIJRmfFh2VLb898xPAgUTN/0BjOK89l6DMPxpqTW1ec5sPb3tw+lvXvOxzA zJ2g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=CwgMybv8; 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; dara=fail header.i=@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 4fb4d7f45d1cf-5c253a87607si27584a12.6.2024.08.31.13.55.12; Sat, 31 Aug 2024 13:55:12 -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=20230601 header.b=CwgMybv8; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AE68568DCC9; Sat, 31 Aug 2024 23:45:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 98FDA68DCC9 for ; Sat, 31 Aug 2024 23:45:44 +0300 (EEST) Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2f50966c478so30758101fa.1 for ; Sat, 31 Aug 2024 13:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725137144; x=1725741944; darn=ffmpeg.org; h=subject:date:from:to:message-id:from:to:cc:subject:date:message-id :reply-to; bh=uU7BWA5/inR5haG3Q48DH/4EQBoYP/g+N9U5wsGdtMU=; b=CwgMybv8WQ8gCVi41ualaX6GXcNvWXiBQpDYoBK6QLSzdC5mmAmFp7cMs+SNSvlYPI vaZD59dqgYExdvu66rvxs70/oMHjDFJCoLJips7Ez7B4MnBtVxXH+6HWQnLyZWOcQ3vZ Lx5X9/h2QHFSDtwl6pAZgY7cuOAKz8Qo7T1HypNGAI/fUK4juVR2VXVHH/od6szrGprv 2THkCvVp/qIap/OUJyQisGA3EIwj4usQ/h3SOD/3D/jhtLUcvf/gBieznsY6n8N4pwOi y87xhyhN4nGd5Y/SksaaV9LaFq4Elbk9sgwZzqfPmsscnAr3d0EYWjQZIM187Qcv/PdR 0JZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725137144; x=1725741944; h=subject:date:from:to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uU7BWA5/inR5haG3Q48DH/4EQBoYP/g+N9U5wsGdtMU=; b=a5FNntHo6Pljuu38QtFeWCLOPd8A7ZD3RT29B1LifPTT47fw7fwcd2s7kXqn03NPsr cryNzoE8wpX192syuWUFL5/2PixFJ+QgblTBwJEHRLVpjctvfwYpkNgd+pYeb+gPJ96r BvgC0/ifqrWyoDHNz7UC7dcmGjJ1vV4Kp5JvR1tGyyeqI5RRT3+DPiq23L6hP90cru+p pWxPf8W1+AVzDbzrthS2fF7OE0ZBO9hkVrqWj5OEaSTTYvbfkAI7EBoEgrLJLWNvY78w N+6wrV2mmdb4AfgGqJrSNEcwzSnun0hx/n4tpcl9iISISxE2MOqal3deG4a2bzKrXPyA eniA== X-Gm-Message-State: AOJu0YxErtU51/WSjDw4HLdAnWi9GzufPjpM25jlzDV30l9IPoNrVDMU uepCTT/tqL0DJ0EeULyQSly3woa/tdAUeVdszZte/wjP0HMcuKRbZQO6Gg== X-Received: by 2002:a2e:4619:0:b0:2ef:2ce0:6ac with SMTP id 38308e7fff4ca-2f61e056621mr34740611fa.22.1725137142924; Sat, 31 Aug 2024 13:45:42 -0700 (PDT) Received: from localhost (p200300cccf117800d4f553fc086e4e41.dip0.t-ipconnect.de. [2003:cc:cf11:7800:d4f5:53fc:86e:4e41]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c226c7bdb1sm3323295a12.44.2024.08.31.13.45.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 31 Aug 2024 13:45:42 -0700 (PDT) Message-Id: To: From: "Marvin Scholz" Date: Sat, 31 Aug 2024 22:45:31 +0200 Subject: [FFmpeg-devel] [PATCH] avformat/iamf_parse: Fix return 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: nEYZB6ZtdAgV The ret value here is not yet intialized so the return would return uninitialized data. What was probably meant to be checked here was the return value of ffio_read_size, which can return an error. Introduced in 38bcb3ba7b3424abd772c72f8bdf445d75285e88 Fixes: CID1618758 --- libavformat/iamf_parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: fa5d3cc65309052402c6e3223d127b930b9e5699 diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c index f13e76b147..8a0003634b 100644 --- a/libavformat/iamf_parse.c +++ b/libavformat/iamf_parse.c @@ -98,8 +98,8 @@ static int aac_decoder_config(IAMFCodecConfig *codec_config, return AVERROR(ENOMEM); codec_config->extradata_size = ffio_read_size(pb, codec_config->extradata, left); - if (ret < 0) - return ret; + if (codec_config->extradata_size < 0) + return codec_config->extradata_size; memset(codec_config->extradata + codec_config->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);