From patchwork Mon Sep 14 05:27:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22357 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 1A5F8448021 for ; Mon, 14 Sep 2020 08:33:51 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EF45868BBA9; Mon, 14 Sep 2020 08:33:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C135268BA7E for ; Mon, 14 Sep 2020 08:33:44 +0300 (EEST) Received: by mail-lf1-f66.google.com with SMTP id u8so12011754lff.1 for ; Sun, 13 Sep 2020 22:33:44 -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 :mime-version:content-transfer-encoding; bh=RfEtpQCgTcHAujhavNnAOthO3DZ/jAUPS5uFVimZFUQ=; b=T1KCRFDesVtMJ+f+iUzW5I600dqiczISfQpMCGMP7H820lDUMCowdvXq2jX4B4I+eW bcI1KOshQ+lqVRS6+W4E86/mBEz6exLUiA971Ae5XowUoygPln5DaJdy7WYdUtbz486K Iq5l87bbJWUzQJFVqjPVn037xnY6winrNPl6Tz7cj3Xq0zBInSzRj6vQuG4j5VjMyGra zq9M+WRV9dI4oW7EclI2rCgU/0nxNPenKFgvNOQY7JtcvLiPKxdeBAYotAHIoY0KS+Sq HnwWX02LP+1YwISYwCOaOcqyRCiuy3dvKoA1mGxZCu2v5MXoMHsJaCNe/vfRRxDQ7pLm qJ1g== 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:mime-version:content-transfer-encoding; bh=RfEtpQCgTcHAujhavNnAOthO3DZ/jAUPS5uFVimZFUQ=; b=laoh2t111/eCZUwf/x0m2vfsrBuD4CaowzgKUFQAVSPJWJXQlBg5HZ/oBZY8WyulC5 K0ZBgT6G8Od5n1SozQhrKxT689EeLlGCcTgLh4B/KvYXWTbfCM+WYzV7mS84fNkrReyo GrJ9ShLw0dYNL5VCys/JWU7YtG0c9+5UQhsuwwDEa6ufG0MDTcs0LtwVHUfT/qmjjNM4 c/ES37xX7VAyYKidQJs/b6LuxSGG/l3wpE3jmYsSpqvZ8sf22kYcWJlfhw+5py1zx0WL Ga1EyYFwuOyqvpmDQlM5sIvb1Rf2eU+kBJp5+1pESTs0KtvT3mbSz3XAKxJxdclepK5s FMIg== X-Gm-Message-State: AOAM530zY6tRKROlDJ2TcyAFstDrQS8IHHpxs9FHoRNYaieGgc8emyA5 rXrJLYdQataREC1lwTg7S38Z8DsRZeY= X-Google-Smtp-Source: ABdhPJx77TVwzM3kFgufYWUqET9nIMZdCXkzGS2L6PRDXiUcFWGS5HbKxJQ+UJFF2f5Lqn7eebFYWg== X-Received: by 2002:a17:906:2a1a:: with SMTP id j26mr12828837eje.456.1600061303452; Sun, 13 Sep 2020 22:28:23 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1fb0f.dynamic.kabel-deutschland.de. [188.193.251.15]) by smtp.gmail.com with ESMTPSA id f4sm8251421edm.76.2020.09.13.22.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 22:28:22 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 14 Sep 2020 07:27:32 +0200 Message-Id: <20200914052747.124118-9-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200913025753.274772-1-andreas.rheinhardt@gmail.com> References: <20200913025753.274772-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 25/40] avcodec/av1dec: Remove redundant second free 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The AV1 decoder has the FF_CODEC_CAP_INIT_CLEANUP flag set and yet the decoder's close function is called manually on some error paths. This is unnecessary and has been removed in this commit. Signed-off-by: Andreas Rheinhardt --- libavcodec/av1dec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 4b89bd83a0..1a9764db55 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -482,7 +482,6 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) for (int i = 0; i < FF_ARRAY_ELEMS(s->ref); i++) { s->ref[i].tf.f = av_frame_alloc(); if (!s->ref[i].tf.f) { - av1_decode_free(avctx); av_log(avctx, AV_LOG_ERROR, "Failed to allocate reference frame buffer %d.\n", i); return AVERROR(ENOMEM); @@ -491,7 +490,6 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) s->cur_frame.tf.f = av_frame_alloc(); if (!s->cur_frame.tf.f) { - av1_decode_free(avctx); av_log(avctx, AV_LOG_ERROR, "Failed to allocate current frame buffer.\n"); return AVERROR(ENOMEM); @@ -506,7 +504,7 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) avctx->extradata_size); if (ret < 0) { av_log(avctx, AV_LOG_WARNING, "Failed to read extradata.\n"); - goto end; + return ret; } seq = ((CodedBitstreamAV1Context *)(s->cbc->priv_data))->sequence_header;