From patchwork Sat May 18 15:35:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus B Spencer X-Patchwork-Id: 48980 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3507344pzb; Sat, 18 May 2024 08:36:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVpST93uUmlpq2hBwL+P+rR7VwKzqlNFPHiUZgXM/8ANaZqJMZYoyvfm8BmLRuiybqh4/97kwJe+CB61AuhLjsgLQUvsCv4r1I71w== X-Google-Smtp-Source: AGHT+IEdXzcf18/IJN06T7LAQx3cuXT23QCVQvZcZVFOSqY7j1E62huj5K19awPUG7DIa8WArfAb X-Received: by 2002:a17:907:2d86:b0:a5a:423:a69f with SMTP id a640c23a62f3a-a5a2d53b9bemr1946558566b.9.1716046585959; Sat, 18 May 2024 08:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716046585; cv=none; d=google.com; s=arc-20160816; b=GTYtIBGjkoJns3CEDMek7bMF3F6OGaCNkeeAV9KZli2Q4vcWLrkz+AHfOV3Gu3owBY HrD3tH1bM6HPgO+O3L1vn0SrInns+Y2ORrDzN3jGTu0IeTsIH25a75HhzMnuYUoCa6+x o+ONw7cq6zUXsa1LVzkip4dF4THZwNqzoYAHlEFKTrlcOJUbrh7wKAYGTuyvL8Vb597M MAMyS6ATK696Lpfd4Gbdq0eFYppqNrLAeWP0LSiZzEyyf9VRGaXCT09uRNLjnnzsis2c lRRhR2BTwxaIurFzuVqBBFhNY9eErtfA+Guw26eQ+qDPOntDbNp9+vtrPHrZB4iYXiIv 8iAg== 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:delivered-to; bh=ZGybrtjVbe0TuqVsteODvSgi8VH1a8BIzM65noePHv8=; fh=JuegC/vje050XLj6U2KtH3S0d9hYf9AYxo0tX+p7f28=; b=Aexc/Ubtrqu7qw1aQweQA1iVar4H4yZnp2GT61Pwl+6Sg9EOVI5CXWQ9k1JgV8ZzoT FIYaQfywRoGa7YMZVdUGf4p9qasx/m3ZWOw810ctT6e7O89pa9iFh5Rm5cciWtBwNOQs 0Pje+usN/Cihh3tCQ6aDIId6+0p3YVLFKQP4anbDxvf/qpXnFoLvgVLctunBcaljA4/0 BQOzN4O9hcD23eeYJiKrT+vXSaLlKTikev9+rJ/zH2rRMC0QP2tBMxVgBUO3Rq/k9KL3 c4gG/bjANZM81eCD+I5KnnoDJDiIghLLc3Wfp35CYa/GRkg1PDB35T3s3L03JvwCOPs6 qJWQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=marcusspencer.xyz Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a5a17b21f5dsi1119614166b.455.2024.05.18.08.36.25; Sat, 18 May 2024 08:36:25 -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; 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=NONE dis=NONE) header.from=marcusspencer.xyz Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A5FB868CF0E; Sat, 18 May 2024 18:36:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp1.dnsmadeeasy.com (smtp1.dnsmadeeasy.com [208.94.147.128]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5A26468C4D9 for ; Sat, 18 May 2024 18:36:15 +0300 (EEST) Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id EFE122F8002D; Sat, 18 May 2024 15:36:13 +0000 (UTC) X-Authenticated-Name: nate@nmssoftware.com Received: from stor01 (unknown [129.224.199.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.dnsmadeeasy.com (Postfix) with ESMTPSA; Sat, 18 May 2024 15:36:13 +0000 (UTC) Received: from marcus.rpi.local (unknown [192.168.26.125]) by stor01 (Postfix) with ESMTP id 239B81CC820; Sat, 18 May 2024 10:36:13 -0500 (CDT) From: Marcus B Spencer To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 May 2024 10:35:36 -0500 Message-Id: <20240518153536.25607-1-marcus@marcusspencer.xyz> X-Mailer: git-send-email 2.39.2 In-Reply-To: <52bc6ecd-ab9b-05dc-6188-027d3859b21b@passwd.hu> References: <52bc6ecd-ab9b-05dc-6188-027d3859b21b@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/aacdec: strictly conform to K&R style 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: Marcus B Spencer Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: xvqimDNxn0za In the K&R style, a single-statement block does not have braces. Edit the code to conform to this rule. It is FFmpeg's code formatting convention to use K&R style. Signed-off-by: Marcus B Spencer --- libavformat/aacdec.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index e267886e1a..d5324df4d5 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -143,9 +143,8 @@ static int handle_id3(AVFormatContext *s, AVPacket *pkt) int ret; ret = av_append_packet(s->pb, pkt, ff_id3v2_tag_len(pkt->data) - pkt->size); - if (ret < 0) { + if (ret < 0) return ret; - } ffio_init_read_context(&pb, pkt->data, pkt->size); ff_id3v2_read_dict(&pb.pub, &metadata, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta); @@ -175,9 +174,8 @@ retry: if (ret < 0) return ret; - if (ret < ADTS_HEADER_SIZE) { + if (ret < ADTS_HEADER_SIZE) return AVERROR(EIO); - } if ((AV_RB16(pkt->data) >> 4) != 0xfff) { // Parse all the ID3 headers between frames @@ -185,9 +183,8 @@ retry: av_assert2(append > 0); ret = av_append_packet(s->pb, pkt, append); - if (ret != append) { + if (ret != append) return AVERROR(EIO); - } if (!ff_id3v2_match(pkt->data, ID3v2_DEFAULT_MAGIC)) { av_packet_unref(pkt); ret = adts_aac_resync(s); @@ -200,9 +197,8 @@ retry: } fsize = (AV_RB32(pkt->data + 3) >> 13) & 0x1FFF; - if (fsize < ADTS_HEADER_SIZE) { + if (fsize < ADTS_HEADER_SIZE) return AVERROR_INVALIDDATA; - } ret = av_append_packet(s->pb, pkt, fsize - pkt->size);