From patchwork Sat Feb 20 07:22:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25835 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 0AA9C4498CA for ; Sat, 20 Feb 2021 09:32:59 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E28B068A880; Sat, 20 Feb 2021 09:32:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7068E68A87F for ; Sat, 20 Feb 2021 09:32:52 +0200 (EET) IronPort-SDR: 5ZvJTiFWWI7n44vafJN6c39gHOWfoHxxdLIV5NjYX9vTnS6kUO11ctCt51Ff01+daH0cuWzd62 6Opl4xph0yqQ== X-IronPort-AV: E=McAfee;i="6000,8403,9900"; a="181506640" X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="181506640" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2021 23:32:46 -0800 IronPort-SDR: pElYEtT9OqEbQKOgaY7uTOE2W7+p9CU98rCTjsSKkJ8e5wU/P4x+xD9q74FxPupjeyz/+Nf0Hk FZb7426Q9Mrw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="440578090" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga001.jf.intel.com with ESMTP; 19 Feb 2021 23:32:44 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Feb 2021 15:22:17 +0800 Message-Id: <20210220072218.31629-7-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210220072218.31629-1-yejun.guo@intel.com> References: <20210220072218.31629-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 7/8] libavcodec/movtextenc.c: fix build warning 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: yejun.guo@intel.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" src/libavcodec/movtextenc.c: In function ‘mov_text_style_start’: src/libavcodec/movtextenc.c:358:26: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (s->count + 1 > SIZE_MAX / sizeof(*s->style_attributes) || ^ --- libavcodec/movtextenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 1bef21e0b9..378d8ae3f9 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -355,7 +355,7 @@ static int mov_text_style_start(MovTextContext *s) StyleBox *tmp; // last style != defaults, end the style entry and start a new one - if (s->count + 1 > SIZE_MAX / sizeof(*s->style_attributes) || + if (s->count + 1 > UINT_MAX / sizeof(*s->style_attributes) || !(tmp = av_fast_realloc(s->style_attributes, &s->style_attributes_bytes_allocated, (s->count + 1) * sizeof(*s->style_attributes)))) {