From patchwork Sun Feb 26 10:07:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 2682 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.149 with SMTP id x21csp557320vsf; Sun, 26 Feb 2017 02:08:09 -0800 (PST) X-Received: by 10.28.98.194 with SMTP id w185mr9910717wmb.84.1488103688953; Sun, 26 Feb 2017 02:08:08 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y81si17333026wrc.135.2017.02.26.02.08.08; Sun, 26 Feb 2017 02:08:08 -0800 (PST) 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CAC43680AAE; Sun, 26 Feb 2017 12:07:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-3.mx.upcmail.net (vie01a-dmta-pe04-3.mx.upcmail.net [62.179.121.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3294C680774 for ; Sun, 26 Feb 2017 12:07:50 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1chvkE-0002dp-Rd for ffmpeg-devel@ffmpeg.org; Sun, 26 Feb 2017 11:07:58 +0100 Received: from [192.168.1.3] ([80.110.113.42]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id pN7v1u01n0uwf8001N7wyR; Sun, 26 Feb 2017 11:07:56 +0100 X-SourceIP: 80.110.113.42 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Sun, 26 Feb 2017 11:07:55 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201702261107.55712.cehoyos@ag.or.at> Subject: [FFmpeg-devel] [PATCH]lavc/xface: Reorder conditions to silence a gcc 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! I believe attached patch does not change the logic of the conditions but silences a (9 times shown, long-time) gcc warning. Please review, Carl Eugen From 2a634f0b1f265f96111895de8603f9deda91d3df Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sun, 26 Feb 2017 11:03:50 +0100 Subject: [PATCH] lavc/xface: Reorder conditions to silence a gcc warning. libavcodec/xface.c:318:27: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow] --- libavcodec/xface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/xface.c b/libavcodec/xface.c index 8c0cbfd..184c174 100644 --- a/libavcodec/xface.c +++ b/libavcodec/xface.c @@ -315,9 +315,9 @@ void ff_xface_generate_face(uint8_t *dst, uint8_t * const src) for (l = i - 2; l <= i + 2; l++) { for (m = j - 2; m <= j; m++) { - if (l >= i && m == j) + if (l <= 0 || l >= i && m == j) continue; - if (l > 0 && l <= XFACE_WIDTH && m > 0) + if (l <= XFACE_WIDTH && m > 0) k = 2*k + src[l + m * XFACE_WIDTH]; } }