From patchwork Sun Jul 22 20:23:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9778 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp5029402jad; Sun, 22 Jul 2018 13:24:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfEJki6rPxtX5NmGzRGk5gObyviRqHdgSmwyFATdBWKC5U7OWQjkf4Y/zUXUZnAN3JGgAo7 X-Received: by 2002:a1c:5b88:: with SMTP id p130-v6mr6128382wmb.69.1532291072607; Sun, 22 Jul 2018 13:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532291072; cv=none; d=google.com; s=arc-20160816; b=YBr26CCDUGXQQVfb0FVZE87HFhfE5XxR8WR+vmMK3J5eMrSA8LJNl8zrz8PBebmkC1 f3LFx740Nb05cJS7ryNr6FA4aXAHDQ6ec6esZhP8wTSDz9ju2//c918+7bqq/VR53I8z OSJD3pJuHVmD5Reqt+RsuOMbnBzYEKqGgQEkb+3bfyTwh0u3yPvtWBtWkLoNPNCIe1y0 K8bHi4DVYhyrDcnv8x2R/0c6TE+zc3CBmp/Tf1EGif7UBoIn9RORdua55Gg1DVKJijYP uEXYTNhmBLufU67Fhlb/4/TPxwZBLhUaBDe8RMggVdsAfn5Lh3+/Mwj0CqTIEMSc2KcU cj+g== 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: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:delivered-to:arc-authentication-results; bh=ae1RO8x7YBHH47J7NnWqQTvBQQL5SoDUs/8H8/ZTWgM=; b=W01el1P+piSrZvH7xiO7RuWsDHAKquvNKm50HBZuywN60FaCa6Wout3sQSOQphhwg4 82RhErXnP8V3bTVkhVTjuAPDnbwH+CdYmUr/5ZVGBOhqZrPPHT0/Am0/l2qee/06YQ0H Na4cAaMU/eAS7opty//vg2mKQQofZkbAxEZjk8bzBPKhfDVHy92hPgNwy1z+l/IvdALj Pwi3mcst0GBiVWd92KVhCDglkvRUCZt/akmYUJnH6poJd1zUHMS5VRe9e5Ap7ZtQ9JTD +VrVC6pgk9lW8qUZdzvuJlCDbVxN70N3stKI344NfTr2mtAG7WYGNRYkfSTMLnNTUg1p ffFA== 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 l18-v6si4519009wme.197.2018.07.22.13.24.32; Sun, 22 Jul 2018 13:24:32 -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 EA353689F37; Sun, 22 Jul 2018 23:23:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-1.mx.upcmail.net (vie01a-dmta-pe06-1.mx.upcmail.net [84.116.36.14]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A66CB689EAD for ; Sun, 22 Jul 2018 23:23:37 +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 1fhKtS-00047s-HZ for ffmpeg-devel@ffmpeg.org; Sun, 22 Jul 2018 22:23:50 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id DwPh1y00V0S5wYM01wPilo; Sun, 22 Jul 2018 22:23:42 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 22 Jul 2018 22:23:20 +0200 Message-Id: <20180722202322.31933-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180722202322.31933-1-michael@niedermayer.cc> References: <20180722202322.31933-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 3/5] avcodec/diracdec: Change frame_number to 64bit as its a 32bit from the bitstream and we also have a -1 special case 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 9291/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6324345860259840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/diracdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index e4cdd7ee2c..4ef1b3ea9b 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -141,7 +141,7 @@ typedef struct DiracContext { GetBitContext gb; AVDiracSeqHeader seq; int seen_sequence_header; - int frame_number; /* number of the next frame to display */ + int64_t frame_number; /* number of the next frame to display */ Plane plane[3]; int chroma_x_shift; int chroma_y_shift; @@ -2310,7 +2310,7 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } if (*got_frame) - s->frame_number = picture->display_picture_number + 1; + s->frame_number = picture->display_picture_number + 1LL; return buf_idx; }