From patchwork Fri Aug 21 21:57:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 21806 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id E3BC844B5D9 for ; Sat, 22 Aug 2020 01:06:09 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CAB9868B6C5; Sat, 22 Aug 2020 01:06:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8156268AE29 for ; Sat, 22 Aug 2020 01:06:03 +0300 (EEST) Received: by mail-wr1-f47.google.com with SMTP id b17so2457490wru.2 for ; Fri, 21 Aug 2020 15:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Zoy2npYLtraijmXDk2+GqFJysXlAWV3Z2Co6P+Kn2zM=; b=OA1fGCARWLtCtqfxdUU7OrFLyEgd1yHbw16nHtiUXTFbvSp+J0P6pTghrvVX6z/Vlr 5irrvgmhf4dCO9WWL/gpH9j8z5+P4SoxXmL5wsR/UqExqO6+crFAslWE5JurEd3vHEyR wGOQMxtqnWSdzwam5zd1AnI5HCgjxeCHXz5iX8iwBasB6IeQRAZBej/DvqPAFtgVFzLj EPU8mMLg1JirgwEM1loKufRf7ObEgdyAiJbAj5RqBgrWxBH95MwJ3CbWsT2Ql3PKVdka HDWXclsOrC/DUQjV3BVbJtIa+88iLpjBbtWLuXCRxC/1QOwxki172Y9g2rNj497wAHIv VrXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zoy2npYLtraijmXDk2+GqFJysXlAWV3Z2Co6P+Kn2zM=; b=PrfMZ6cVWaYT9ganWQN77GdN+qRnIrdVWkqCThP6+DYGjR1PcAJAMjHTUSamEGKnRW 4Djy9L91lQ7qcfPargmzaWH5ZITLTwwQkjLdTB39XoTorWyrEzdw2vN96DBnTexTuhBH TDzLSNqNf5cx4ha0SOE4LiOo24nmsXkFFg1FYzOEYaP9jqfCaCROn/qjSnKHqLKtvhoV 8GEouDqbcxRfuJRm7BbKATwrpI7yaybpFsgQ0zyLSylk0nVkVkLisL6xj9ASI5xX3DD/ pOTVpSnCcWENIo2mznxjFvHpliH6NsS7blwqLpyWyKIj+LKmYagGlotlKbatRg9Jm8nj +IGA== X-Gm-Message-State: AOAM533/Wezz82YbsQiRdfnB+n06Fcda3CZ2mADo42s5H9YheMqce5QO eIl+YZZF+kSYj+S14NPr0zbSUY1pZSU= X-Google-Smtp-Source: ABdhPJz13b1KcQeRLSTGjFYI0Jpf81zhwUngzNcjQdQ8v75R4L3LoTtExS99LuqvyHrGLc6M4YzyAg== X-Received: by 2002:a05:6512:3185:: with SMTP id i5mr2226047lfe.205.1598047083112; Fri, 21 Aug 2020 14:58:03 -0700 (PDT) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id v10sm629134lfo.11.2020.08.21.14.58.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 14:58:01 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Sat, 22 Aug 2020 00:57:57 +0300 Message-Id: <20200821215800.27162-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818192538.35023-1-jeebjp@gmail.com> References: <20200818192538.35023-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 0/3 v2] avcodec/aacdec_template: improvements to 22.2 layout logic X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Compared to v1: * Left and right are being handled separately in case of assign_pair()'s 2x SCE mode. (patch 1/3) * Exact coding element is also checked instead of just coding element channel type in sniff_channel_order()'s 22.2 specific if statement. (patch 2/3) * Last check in sniff_channel_order() for 22.2 is simplified to just the channel layout. The if already does enough checking and if the input ended up getting the full 22.2 layout, we are good to go. (patch 2/3) The first two commits fix both of the fuzzing samples I have on hand. One being from #8845, and another provided privately by Michael. Changes have been tested both with clang 10's ASAN as well as standard valgrind. The last commit is general debug logging that I found helpful during adding support of 22.2 by logging the element order before/after reorder. This one, if found non-interesting, can just be ignored. I decided to post it as it was part of my verification. Jan Ekström (3): avcodec/aacdec_template: keep tabs on layout in sniff_channel_order avcodec/aacdec_template: add more checks to make sure only 22.2 gets to 22.2 avcodec/aacdec_template: log the element order before/after reordering libavcodec/aacdec_template.c | 129 ++++++++++++++++++++++++++++------- 1 file changed, 106 insertions(+), 23 deletions(-)