From patchwork Sun Jan 21 00:52:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 7377 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.156.27 with SMTP id q27csp1273528jak; Sat, 20 Jan 2018 16:52:29 -0800 (PST) X-Google-Smtp-Source: AH8x227nClfKZreYBPymZOymy9XAFaIJfsXTS8NgB2QTaH9iFxJqjeq+P6u3FiOsFh1sF8tfm0h2 X-Received: by 10.28.202.5 with SMTP id a5mr1745662wmg.103.1516495949360; Sat, 20 Jan 2018 16:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516495949; cv=none; d=google.com; s=arc-20160816; b=ND7xNL+O/05gZ3xBQPRv56O/0Rm1Zqky+k3PtC2UIY0+VxGYHk6gv4s/Fhgc5YzGDi nklrEmJgX2R5/Y+bW3E8WRqyDF9aGSUfh7b5lyDo/F9Wh8E8porl/zk/Dk3+tI7BoG72 FzHupsAKJ/3l8FSu5+PnZi1jZFvIzRz9Raaus5ymRD9F06+xZPSmCoftooTGbVovCKhU hhpPc0LT50NZc92tSBA6Hg9qwfUtptosHs+EeChlj9DsGj2p3oIoZuY75s29fhsJ5OQ+ EbaPVpVLFmZzi+ZO38tBGEp9Y+Gq5ljJT5lSpvE/FSVYJzdkGCc+9J45QlioBsg5n6bW tLTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:mime-version:user-agent:date :message-id:from:to:dkim-signature:delivered-to :arc-authentication-results; bh=UuI+0QQiXbj/ys0q/14me87E9mPWGN9u9vmOj5izueA=; b=CIP9xojMMpS67RC+oUmvNy1ye9bKQUybAH3iFXDBaMYCuRpyA1Ygn7G6NRNKyg6H/i 575Wz7ybUYIlhMeGX2P1kFrWzku49zflBhMkIULahXcxqqdt9morOpxPfjkpUWJBSzVj eFfvLNXgsE5I/WtvvBRstU9JB7DyGhW+5ot2bD76Bu1s4CcSTBMX9GLNUaANmoWbiCqQ j7MQiQUs/kPnmuZPPO3hbUQgOPL2jnPQQQH3CGcCWoXbWRxbYhYrWDDVvY710i36/PIA fZ6dPL88ARivSDjNw1w18Spglbl8SJ2lK55I7yJJee9pV8nVVGIPmlBA6aS4Pov7mUaZ OZBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=ok19rcuW; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n188si2955581wmd.49.2018.01.20.16.52.28; Sat, 20 Jan 2018 16:52:29 -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; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=ok19rcuW; 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 C8F40689EDC; Sun, 21 Jan 2018 02:52:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B800689EDC for ; Sun, 21 Jan 2018 02:52:19 +0200 (EET) Received: by mail-wm0-f65.google.com with SMTP id b21so10275475wme.4 for ; Sat, 20 Jan 2018 16:52:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=6pdydUeoZ6DbShURcDPYjq7wZCE5xaUYV9rENpu2H9w=; b=ok19rcuWrsbuxFhApg4t+I7k9m8og2UiTAyAGNhDZDWsazQOCRWJR/QvX8RWZfANRj hN/BAcralyPCxiuubDjAouwqZVY4L63sLI6Nw3PEYetMFvvY+JwhZxm9dus5e7MbGooU Wi8JRrvKSfYR8RDlSa4WWI5yH7XUEA0ju2bW0UdxKgiVUjGTIQlCelBlh6us8RGhNevR p2W99S9iKL7m1bxsHFv+7BZAhXdw/b1hd0yhoE6EVW3iX0P8zMTqK+mKVTr8iKVdTKAF 6gIGeUd/+Q8OlSVC6tu2jVMxXfRNaoPbt1wP/+RS6byA5H8GqWNsN+OA0vMIDqBQMYuE Wl9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=6pdydUeoZ6DbShURcDPYjq7wZCE5xaUYV9rENpu2H9w=; b=Sv74hMCsRTB/nm2BsXFIsZoUDQ3cd6JaPfb42H0/ESlBg/Kl8h2AEueOIcYPkFumAE fC0GpW0vZ7kQvPAQNSLs5decr1STA/B68+y618phWaF3zqkyJAkXTvbft+r7mN2RbiF1 Nv1f/dgO+OnQjeuev7e4bpUe3eZ4NAlN0aM6NmppYFL3RuzXZQv6WzxGbg6xaxsbZZKI e8MFZwCNYfAMez84Usiq9YM7AylWoaTcKwxWqg20Xvp89nnaM8jwWsEmN5AzgBR3iAJg lzOIMjevKnRlSMVSPydCLJWJ8p6J58XtuGaL2t1f4/JEQPK5VLcVqhDJ9SdAbDwjuTFu pGAg== X-Gm-Message-State: AKwxytc2iMgOtP9Y7yiQt2a2So0E6f8NvyZKeaj5dww1mTS6phHTw/2c 0UYDZznx+CRxP33+NK7bX03I2ymr X-Received: by 10.28.15.13 with SMTP id 13mr1802629wmp.105.1516495940325; Sat, 20 Jan 2018 16:52:20 -0800 (PST) Received: from [192.168.0.3] (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id j132sm7355700wmd.7.2018.01.20.16.52.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jan 2018 16:52:19 -0800 (PST) To: FFmpeg development discussions and patches From: Mark Thompson Message-ID: Date: Sun, 21 Jan 2018 00:52:18 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH] v4l2_m2m: Fix integer overflow in timestamp handling 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" --- struct timeval elements are not big enough in a 32-bit ABI. libavcodec/v4l2_buffers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c index 8e4d4d1..aef911f 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -69,7 +69,8 @@ static inline uint64_t v4l2_get_pts(V4L2Buffer *avbuf) int64_t v4l2_pts; /* convert pts back to encoder timebase */ - v4l2_pts = avbuf->buf.timestamp.tv_sec * USEC_PER_SEC + avbuf->buf.timestamp.tv_usec; + v4l2_pts = (int64_t)avbuf->buf.timestamp.tv_sec * USEC_PER_SEC + + avbuf->buf.timestamp.tv_usec; return av_rescale_q(v4l2_pts, v4l2_timebase, s->avctx->time_base); }