From patchwork Wed Dec 11 22:00:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 16744 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 D4C344496BC for ; Thu, 12 Dec 2019 00:00:53 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B43A968AA75; Thu, 12 Dec 2019 00:00:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vs1-f68.google.com (mail-vs1-f68.google.com [209.85.217.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E1BFF6899F2 for ; Thu, 12 Dec 2019 00:00:47 +0200 (EET) Received: by mail-vs1-f68.google.com with SMTP id x123so133449vsc.2 for ; Wed, 11 Dec 2019 14:00:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=kRlfA1pQ8VeCpYhQty2bXDvFYLwo0tZ+a29zqwyDXRI=; b=M5qkcTwChKvqiy9PYP4ZS+seqQxyKDwcFIGFL4cHy4vdUHPyWM7Sv+lWMlyHWEyEx3 cxh0O/27sI4HhERSIlGhXZgUULFTGG1ZyiT5DWhiOnMNVYLNvk9H4QZkSqWvh6XKoPjH lbCTi1yjqNWaew1H0xfhzRniK8u0TO+VQ3ccJrvxMFzJySukcKQQkZ6tpQ7tAkD4uN47 14jpxRVJhDUpAzl9fxdri1LYJuWkur/DAng54otSdhqIt2PGSof3NuQ9Jy0D/57n9JXl rtKBy0mMAXbq5Eb+/ltZzvt6CSQV6NdbgdxC/Xqid9g0S8TUObL49Rr47+0QUmEIzODN pvNA== 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:mime-version :content-transfer-encoding; bh=kRlfA1pQ8VeCpYhQty2bXDvFYLwo0tZ+a29zqwyDXRI=; b=lzSuYaBNmavxgcYgIuqeoLboWVUbgF8C1WKlSMLjOUv7rG5rMvU34XKb+iZLPOaN7y H2ijSQa7HtORT0sfrwFnadt8VcsRazTvdUUmrYYPzk9ElGSXxw4gas0o0j2F2qUiR06e EPbUv2IeC7TrwA0EZrZibBhJDEBwEEnv0oZkzx4M5jCeyGr++DAeksCpRLXChrjJyOL9 yk8FYwUn2fs7lb7y7oxZ+lU4QgOtV7YWatslo29ZCnHFRXm8mLzDZWNosIbqfC1kXnEo 1FLcKzq1rJN66YJhshFGAebfv4scbnf57G3dnsdqnOha7UW531PzGlDBWSXMdy9Ov6cS 8HGQ== X-Gm-Message-State: APjAAAVxrkk3vcGI3OFMR0dgThqphrQuDFZMmpzBrCVQ60NVZzT3EDn1 l58Y9lj/WaB+UsfOfSWhvcxxk2ABk9o= X-Google-Smtp-Source: APXvYqxCG+A7tpSMMB/22qhvtYUfhtw3pOTy9bSItMrR+UTZOV0vcpfAW78JNQ3EZGTRNs18gzkilg== X-Received: by 2002:a67:bb19:: with SMTP id m25mr4734297vsn.68.1576101646298; Wed, 11 Dec 2019 14:00:46 -0800 (PST) Received: from localhost.localdomain ([181.23.76.65]) by smtp.gmail.com with ESMTPSA id w20sm1883445vsf.34.2019.12.11.14.00.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 14:00:45 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 11 Dec 2019 19:00:06 -0300 Message-Id: <20191211220006.1286-1-jamrial@gmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/cbs_av1: fix array size for ar_coeffs_cb_plus_128 and ar_coeffs_cr_plus_128 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" Taking into account the code fb(2, ar_coeff_lag); num_pos_luma = 2 * current->ar_coeff_lag * (current->ar_coeff_lag + 1); if (current->num_y_points) num_pos_chroma = num_pos_luma + 1; else num_pos_chroma = num_pos_luma; Max value for ar_coeff_lag is 3 (two bits), for num_pos_luma 24, and for num_pos_chroma 25. Both ar_coeffs_cb_plus_128 and ar_coeffs_cr_plus_128 may have up to num_pos_chroma values. Signed-off-by: James Almer --- libavcodec/cbs_av1.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h index 50a05d2168..643e76793f 100644 --- a/libavcodec/cbs_av1.h +++ b/libavcodec/cbs_av1.h @@ -268,8 +268,8 @@ typedef struct AV1RawFrameHeader { uint8_t grain_scaling_minus_8; uint8_t ar_coeff_lag; uint8_t ar_coeffs_y_plus_128[24]; - uint8_t ar_coeffs_cb_plus_128[24]; - uint8_t ar_coeffs_cr_plus_128[24]; + uint8_t ar_coeffs_cb_plus_128[25]; + uint8_t ar_coeffs_cr_plus_128[25]; uint8_t ar_coeff_shift_minus_6; uint8_t grain_scale_shift; uint8_t cb_mult;