From patchwork Mon May 21 21:30:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9041 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp754403jad; Mon, 21 May 2018 14:32:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZotLRKa+qmEr2M5CHx3ZMwY6Zit15EMl+aw2yVoLQolSVCj+O6aiij9qM02xl6AtNI06YQp X-Received: by 2002:a1c:eace:: with SMTP id g75-v6mr284055wmi.76.1526938358499; Mon, 21 May 2018 14:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526938358; cv=none; d=google.com; s=arc-20160816; b=0eQpqw6eXRZBWceN/dZxhZQm3svVV1RjS7ZuU1HguljKcxa5ie4O0mM8BKg5/U9Qaq huU2b/NCmttEBs48PKTg7h2vRMd2whHM4I6HIgomH6VME1BMh3SGpMz7fhqAzO1tVjEz az4RirdVRZinEUeSTSf+tbnDVVJHni/5NZZlBvgoVIWqgZ+lWWpfE2JEaJ0n4AutS2F5 dCGtNVdgF0v7nHSx4L26I9yb0vKZNFSegmZInz3bwBi0CD7mokGiXf+CcvR9Gb6/qVcu c95tVPdP6elCnWf3ahe174XdFGhuWvJUMOqtu4HY99Vk99bSlN09Y4B51mRP8cOf/P3y UxKA== 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:mime-version:message-id:date:to:from :delivered-to:arc-authentication-results; bh=JwOrDm/ETcX3kMLzgmEYmIDkz2TkhrQyxEJ/vss/z+0=; b=Pd9LdESIU8UsG4xXuHsBHI1a+y/gcN0mn3QT4Ob8SWBmzrUDM8WoLcbkIjAsmAQgtL aNVu5/OYVPo2PtvBnItWhEHXJMr5yakmMChy9lF2AtiYS8RyIlWavRxTE7W91LzbPv6P TU5FIM+bZCTHqt6fciBvQmmVM2f+cEbb9Id1stCQ70oIa8O8qIzPKS+GkJRELIh9q6+o JKhLZ/n+PloKzftX+5QmH/bikOEkJsOOg7xu4Lrt69EGpqWD0OFvF9/aO0t9/+dKMWNY gzk62c94c3qkQop+SJyqsBivqAU83aVSneotcpoe7PF7jEqaZ+wJtXeQ1tpBXg7j+X/S G6HQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a25-v6si13516040wra.233.2018.05.21.14.32.37; Mon, 21 May 2018 14:32: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; 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 858D768990D; Tue, 22 May 2018 00:31:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-2.mx.upcmail.net (vie01a-dmta-pe06-2.mx.upcmail.net [84.116.36.15]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1EAD4680280 for ; Tue, 22 May 2018 00:31:50 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fKsPu-0005bH-Ok for ffmpeg-devel@ffmpeg.org; Mon, 21 May 2018 23:32:30 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id p9YU1x00l0S5wYM019YVvw; Mon, 21 May 2018 23:32:29 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 21 May 2018 23:30:51 +0200 Message-Id: <20180521213051.21993-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/mpeg4videoenc: Use 64 bit for times in mpeg4_encode_gop_header() 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" Fixes truncation Fixes Assertion n <= 31 && value < (1U << n) failed at libavcodec/put_bits.h:169 Fixes: ffmpeg_crash_2.avi Found-by: Thuan Pham , Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart Signed-off-by: Michael Niedermayer --- libavcodec/mpeg4videoenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index 494452c938..f6a5992df7 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -882,7 +882,7 @@ void ff_set_mpeg4_time(MpegEncContext *s) static void mpeg4_encode_gop_header(MpegEncContext *s) { - int hours, minutes, seconds; + int64_t hours, minutes, seconds; int64_t time; put_bits(&s->pb, 16, 0);