From patchwork Tue Oct 2 01:04:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 10578 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:ab0:73d2:0:0:0:0:0 with SMTP id m18csp2325210uaq; Mon, 1 Oct 2018 18:06:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV61UTkKmXaNGJXNaExVmnbrQBsVMrhrPC7/Yw8nZy4jjS5PgR3B6Nx2UI/uxPh0pGICrrGdd X-Received: by 2002:a1c:a683:: with SMTP id p125-v6mr286675wme.24.1538442381160; Mon, 01 Oct 2018 18:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538442381; cv=none; d=google.com; s=arc-20160816; b=XGOOlpOiq3Dvq0lwpRwOTOPhrdRbZ37xylhCUZJOWZbL6uZxxCIs2vP+wTkPOoN9b6 ZcZpyKUlSzIZbPNvcIiss8xeSiMKryw9uJRyIKayJ7UV5lUgcWoECtngAAFpUP9kc8IO HzhO5qj5Qvm8g8qDZdrnCaQF+2lO9cqin5KCjJjeaEys8BZq6neP7RTpmvcgPJCNDNOO J/etVxbH7k7RKB6jeP/UpsAMu+Y9/bnvx5n2v2wJz3TIEzuZMnLBtDCfVlGQBXybEjko N48hwvz1jcPTgMem22iKZJ9XMH19a3Z/wGBXlfOde/StxYf/t7PyCKBBaInjTGOhOvtC Xbtg== 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:references:in-reply-to:message-id :date:to:from:delivered-to; bh=EA/kGE36EdBRXX9Jqsmv2AYrTf/cQzVLiQSy+2h8btY=; b=ZhcvPlUHVTu06MqZj7A4GBSItYk41/3+2MX6dolBo32kej8BypaplBZs3IfxGynkHP amlnp4chbpSJ9bx9zbSuEhsGh/4WJewxIlgwZ7J9C+CJcjJUdI0pUjd0VaR7cc84rwc6 mjLzyB2tC+hkTr4CvNpC9orkoNT8yfkYYdQHx2ojl1CSWFmSfPmCoBpVjvKdTFyNI65W YsOEcLIY+B2Y0SkwteJKLcojNVwzgQHyYzKBr4SpRjCYxvQWIu0YAiGz/Sl/M+lHe59s cfwT856B9qOTLRiX58Rq+noMoVLmktYd0anazKiU8vXGATAnXd7Nhs/u0oDAb24o4NYt UcLw== 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 r9-v6si9676082wro.197.2018.10.01.18.06.20; Mon, 01 Oct 2018 18:06:21 -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 8863068A23A; Tue, 2 Oct 2018 04:05:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-1.mx.upcmail.net (vie01a-dmta-pe04-1.mx.upcmail.net [62.179.121.163]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7583E68A1F0 for ; Tue, 2 Oct 2018 04:05:41 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1g798S-0000Re-4i for ffmpeg-devel@ffmpeg.org; Tue, 02 Oct 2018 03:06:00 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id iR5s1y0030S5wYM01R5tzS; Tue, 02 Oct 2018 03:05:53 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 2 Oct 2018 03:04:52 +0200 Message-Id: <20181002010452.12356-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181002010452.12356-1-michael@niedermayer.cc> References: <20181002010452.12356-1-michael@niedermayer.cc> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/rasc: unref both frames on reinit 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: integer overflow Fixes: inconsistent frame dimensions Fixes: 10454/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5656301162463232 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/rasc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/rasc.c b/libavcodec/rasc.c index eb021681c6..e8e0740ddd 100644 --- a/libavcodec/rasc.c +++ b/libavcodec/rasc.c @@ -95,10 +95,10 @@ static int init_frames(AVCodecContext *avctx) int ret; av_frame_unref(s->frame1); + av_frame_unref(s->frame2); if ((ret = ff_get_buffer(avctx, s->frame1, 0)) < 0) return ret; - av_frame_unref(s->frame2); if ((ret = ff_get_buffer(avctx, s->frame2, 0)) < 0) return ret;