From patchwork Tue Aug 30 07:11:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Burgess IV X-Patchwork-Id: 334 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp2098930vsd; Tue, 30 Aug 2016 01:08:29 -0700 (PDT) X-Received: by 10.28.221.8 with SMTP id u8mr2608707wmg.61.1472544509687; Tue, 30 Aug 2016 01:08:29 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id s21si3359236wmd.21.2016.08.30.01.08.29; Tue, 30 Aug 2016 01:08:29 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@chromium.org; 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; dmarc=fail (p=NONE dis=NONE) header.from=chromium.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B7CAE689C26; Tue, 30 Aug 2016 11:08:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 59FF9689C24 for ; Tue, 30 Aug 2016 10:11:50 +0300 (EEST) Received: by mail-pa0-f44.google.com with SMTP id hb8so4706392pac.2 for ; Tue, 30 Aug 2016 00:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=K4ayLI7YzOkyJWpLsA0vNl3ChWpK85nKoZZbYVrHA7s=; b=R/1AMDx/IFoBAP6M24pXtoZkfAqThD+KiWowy0wNpRBaCeX4BAaP0RTb8p3Wv+xMc6 916Me/Tce1JrimLL+fToO8sPdaR4kLtFN1KK9f+8T55G6UWJN7r4p4N6NSnJLEiwq+ZH 0vMdIRgdTC9wVQVAuZux/OYoyqAZ0ADh4dCFw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=K4ayLI7YzOkyJWpLsA0vNl3ChWpK85nKoZZbYVrHA7s=; b=QtB6ltpV67rpqL1kFlABpsWmh7/hknyQtTaszVIyXAodgDzeIejAC+WABOnJ/tRK4P gxYXkQXJvU0W383yHt5jYKtz7p6O9BubK4nltAudkAB9UqlWWFWma/9iH8XFqEVvCIZt RrQfryZIaV1aKu/Egvyx4b5PzveIh5/28liOPVEw+HE3WXQp6OiW2ZTN59L2ZCR/QR9f Zvg/W/HiAWsHPpVYRL+oJZCpvXmjgzgiGSH9x7bngXKEMflXfRrBDt5YPnrL4fFx19BF tf5JIa0DwNeWhu8zfqOY/R2liVVLd9+0bQvdCNbela+gQZmNzCqs5HveKZxKqG5hEh7u 2CAA== X-Gm-Message-State: AE9vXwMFJgdmTpZOUglRGZYZF1io02vwT/rAZgV8NTuB0MA/PTBn5VDGDd3U2ag3xpJIpWlY X-Received: by 10.66.9.42 with SMTP id w10mr3671487paa.34.1472541113695; Tue, 30 Aug 2016 00:11:53 -0700 (PDT) Received: from gbiv-desktop.mtv.corp.google.com ([172.17.222.222]) by smtp.gmail.com with ESMTPSA id uc1sm54190123pac.24.2016.08.30.00.11.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Aug 2016 00:11:53 -0700 (PDT) From: George Burgess IV To: ffmpeg-devel@ffmpeg.org Date: Tue, 30 Aug 2016 00:11:42 -0700 Message-Id: <1472541102-37897-1-git-send-email-gbiv@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Subject: [FFmpeg-devel] [PATCH] libavutil: let clang-FORTIFY build; NFC. 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: George Burgess IV MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" ChromeOS is adopting a new FORTIFY implementation tailored for clang. As an artifact of how this new FORTIFY is implemented, a handful of implicit conversion warnings get turned into errors. This patch fixes the implicit conversions in ffmpeg that clang-FORTIFY has an issue with. Signed-off-by: George Burgess IV --- libavutil/opt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index cd16bd1..f7f5225 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -733,7 +733,8 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val) { void *dst, *target_obj; const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj); - uint8_t *bin, buf[128]; + uint8_t *bin; + char buf[128]; int len, i, ret; int64_t i64; @@ -795,7 +796,7 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val) } bin = *(uint8_t **)dst; for (i = 0; i < len; i++) - snprintf(*out_val + i * 2, 3, "%02X", bin[i]); + snprintf(*(char **)out_val + i * 2, 3, "%02X", bin[i]); return 0; case AV_OPT_TYPE_IMAGE_SIZE: ret = snprintf(buf, sizeof(buf), "%dx%d", ((int *)dst)[0], ((int *)dst)[1]);