From patchwork Sat Sep 2 19:07:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paras X-Patchwork-Id: 4954 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1735501jao; Sat, 2 Sep 2017 12:35:38 -0700 (PDT) X-Received: by 10.223.192.14 with SMTP id z14mr1290500wre.292.1504380938834; Sat, 02 Sep 2017 12:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504380938; cv=none; d=google.com; s=arc-20160816; b=uPzSe2LFpwqB9B8Rc9OrvX8RdPpvDrqhVO9pUa3CxIpnLSErM3c0xXVVYkyw/DqtfF ed46JslnfDC/BX6AwZeHs1vdVAQkpE0g0lExMacQwjEZ3DtqnID9HjIYveutpvgPXHVB h3BmztlLoBDn+wylOAdhUsU6d9X5+AKCiyJz1Qt1BEilhcu2MiGp9kOqo5Dp8aXUtdDM cNnI8jFGot3bqYBPGYSdRWdufVcobeTsGkYsV20I7Ej6O5WNFm1BgbeC94A6GNg5MglE QUyWn2OBZZ30HrYGHmk2v46iXjjrD1hgVNfZO8kzsD4COrGzpzDOQ4j9G8XgI6RSeXA5 L3vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=Tnkg3Y9b/Hv8DQORkSR16lJyG5hnyeWVi0kXxytJ/Jc=; b=XfKd4cMBcKRdSB6NuD2oyG86mjwEFCgkntux5YOMG2HQUyA6E0bnIAseKk7Ozpvt7j qf37HP1kKyoF7fDsoaobLRY7ATbTOT+Ge18b4Mk8kFiVNwAxxkygQDOrXiJUIRI6/GqL ScrtaiHPIwNUaW+Ktcjv3ohj7baqI71vRs0GRbwJpLwct57WTmZalX8HhxvxlKIxnEGc 94orO1os1HdRzY7RGSkV08LqhP0zdr7XjW94QkMdQOlPa8HYewedcx8I7iOe4Zu0vK0O 9wfnItBGwZdrgFEQU5xjZKb30Mhcdpqh+ehdWZvWk6IswVYAsuLnvahAE65DDhHzVkEY Hnew== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=kmri4ZJQ; 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 sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 12si2112028wme.229.2017.09.02.12.35.38; Sat, 02 Sep 2017 12:35:38 -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=@gmail.com header.s=20161025 header.b=kmri4ZJQ; 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 sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 87D27689E29; Sat, 2 Sep 2017 22:35:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 94F09689DBC for ; Sat, 2 Sep 2017 22:35:29 +0300 (EEST) Received: by mail-pf0-f194.google.com with SMTP id r25so2049229pfk.0 for ; Sat, 02 Sep 2017 12:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MTCQaLucHgno9xA2/lYhCdBpD/7ISY1fvUtpWLNMA4Y=; b=kmri4ZJQmcjH3ycT+wIqAZI4GRtakppAxPGNUqliFefF2sIV7EgonAs9ydstRM+ECU J+YHSowSN33jciN5OFEAX9deGTPjM8V8x5MTSASHcGuLwwt89EQcSCLaiga0Gz6B8Y4N EG9k5Ytf09Imv6naZqwNhMiLw0tteOZELcYrs0JmVMmX2Wk8nk6tg3IJfSR+TLCQlwSx RZB4c6NZGvO2AxOSkbYEwmGyN5ghRZtcNGu9H7wPamX5mHxsk05JwcNvHbyYtypkGWCz pUnjHbNsUMLSLCViwEgVaK8JI+a4DqBFo3/A1iqjAQnkZurs4WWPlcfx7TYHAKv0pPA0 8rtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MTCQaLucHgno9xA2/lYhCdBpD/7ISY1fvUtpWLNMA4Y=; b=GIB5MTo3O5VRqhqVzekuBwwO2i/f1ryW36BPPpqbtjSMJNyqJoj0sot/6PkpybT9GU yQbW4YYlYYIM+/DCFITYfJNdF8ZF0vr+KIHFK9+gvUsJ5V6hpVMmYOdcd3wmo90/D8Oz 7eG4bQocpkicrVx+8p+85OdQ/I0/x51DmIOkT18bU9dUgsD88+P43ul3RYh4yBrn22rr NJ6zNoXLBxoWJPp30U6ZpN431zaTC6EsLyw6N13rXV6DitfUHJ8bu6uM+MrXyh/orfDk N/5Kk2pZVLui3+NrGvxtJtw1YV5Saj7/UfXexuaC1xmIJ8QK+/YTA/mFd5k7YfaH2Gch meoQ== X-Gm-Message-State: AHPjjUgcTZayoaGJF+o3HGgrdzxIjPZ04zAtS6VmD/LpwNXMfqSk9CQo hffGbTDHkaBLRjny X-Google-Smtp-Source: ADKCNb4EVi9Io1pRlIaHua5zIuRbuv6ZNbhqKHU1IFk+fhTgOdjmoKAUFnWbyrw+qq5MF2yjxr60/w== X-Received: by 10.98.131.73 with SMTP id h70mr6708034pfe.327.1504379266070; Sat, 02 Sep 2017 12:07:46 -0700 (PDT) Received: from dhcppc9.localdomain ([124.253.208.210]) by smtp.gmail.com with ESMTPSA id q15sm4399237pgc.64.2017.09.02.12.07.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Sep 2017 12:07:45 -0700 (PDT) From: Paras Chadha To: ffmpeg-devel@ffmpeg.org Date: Sun, 3 Sep 2017 00:37:22 +0530 Message-Id: <1504379242-8281-2-git-send-email-paraschadha18@gmail.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1504379242-8281-1-git-send-email-paraschadha18@gmail.com> References: <1504379242-8281-1-git-send-email-paraschadha18@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] avformat/fitsenc: fill header line with spaces 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: Paras Chadha MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Paras Chadha --- This fixes the failed fate tests on msvc12: http://fate.ffmpeg.org/report.cgi?time=20170901190511&slot=x86_32-msvc12-windows-native http://fate.ffmpeg.org/report.cgi?time=20170901211336&slot=x86_64-msvc12-windows-native Tests failed because snprintf was filling the buffer with '\0' chars after printing. libavformat/fitsenc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.4.11 diff --git a/libavformat/fitsenc.c b/libavformat/fitsenc.c index 0dcdcdf..1a4b7c2 100644 --- a/libavformat/fitsenc.c +++ b/libavformat/fitsenc.c @@ -47,7 +47,7 @@ static int fits_write_header(AVFormatContext *s) */ static int write_keyword_value(AVFormatContext *s, const char *keyword, int value, int *lines_written) { - int len, ret; + int len, ret, i; uint8_t header[80]; len = strlen(keyword); @@ -58,7 +58,9 @@ static int write_keyword_value(AVFormatContext *s, const char *keyword, int valu header[9] = ' '; ret = snprintf(header + 10, 70, "%d", value); - header[ret + 10] = ' '; + for (i = ret + 10; i < 80; i++) { + header[i] = ' '; + } avio_write(s->pb, header, sizeof(header)); *lines_written += 1;