From patchwork Thu Aug 6 08:04:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xu, Guangxin" X-Patchwork-Id: 21511 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 9E771448957 for ; Thu, 6 Aug 2020 11:04:52 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 88AFA68BABC; Thu, 6 Aug 2020 11:04:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9CDE968B5E0 for ; Thu, 6 Aug 2020 11:04:45 +0300 (EEST) IronPort-SDR: /OSp8v3V7oDY4IUmkhzCAHtakYTHksvVIxlG094GfszhyDiXwADwlUUwDdBStxw4TB2/glfURi +ZSR+PPcK0Jg== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="140349974" X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="140349974" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2020 01:04:42 -0700 IronPort-SDR: lbPqh1S0vpOI3MfiX+NRcmA8EAiVr0uw3ylrNcCQJO2MAIFJrkxSw5lbewcfdgaxCXFLHHKESp npTK08EuFfrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="493587698" Received: from skl-e5-server.sh.intel.com ([10.239.43.170]) by fmsmga005.fm.intel.com with ESMTP; 06 Aug 2020 01:04:41 -0700 From: Xu Guangxin To: ffmpeg-devel@ffmpeg.org, jamrial@gmail.com Date: Thu, 6 Aug 2020 16:04:13 +0800 Message-Id: <20200806080416.17691-3-guangxin.xu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806080416.17691-1-guangxin.xu@intel.com> References: <20200806080416.17691-1-guangxin.xu@intel.com> Subject: [FFmpeg-devel] [PATCH 2/5] av1_parser: do not check buf_size if we have size in obu header 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 Cc: Xu Guangxin MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" for low overhead obu, we can't forsee the obu size. we can only get it when we parsed the obu header. --- libavcodec/av1_parse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/av1_parse.h b/libavcodec/av1_parse.h index a3b39f039c..823bdedd5e 100644 --- a/libavcodec/av1_parse.h +++ b/libavcodec/av1_parse.h @@ -135,7 +135,7 @@ static inline int parse_obu_header(const uint8_t *buf, int buf_size, size = *obu_size + *start_pos; - if (size > buf_size) + if (!*has_size_flag && size > buf_size) return AVERROR_INVALIDDATA; return size;