From patchwork Mon Sep 14 05:27:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22352 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 048AA44A49B for ; Mon, 14 Sep 2020 08:28:38 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DEA9768BB39; Mon, 14 Sep 2020 08:28:37 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6158168BB3D for ; Mon, 14 Sep 2020 08:28:35 +0300 (EEST) Received: by mail-ej1-f68.google.com with SMTP id z22so21322693ejl.7 for ; Sun, 13 Sep 2020 22:28:35 -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=fOQA8dYGFzWNSbeU/ZKnLzZA3t5DaEY7PF07zCH7DO0=; b=Wuv9QV41042ERbgNJ06PRVHZOWPfLwF5wRRNw39CRy5M28peypzSwaH+4T5JSrjOUA V8fXcr0dDiu8ZEZ7iEnPkdCMYVTGpTlMbklZK3hsazlpK7LbCEhWrGEn69oDf503BPbk rJPh+TNI0oUm4k64WMV74LuvmjyAZl9RFkrClK28dvrVXyMSPhIzUHiu/ppD/itZCYS+ XNJWLTHa070Osn5XhA53hTg1zrjpML4xckssf1QSs9dPT8r/n/c83wjKWIABB1rYLU8J zRvPWgDKOutMw38Bp483pQBm1RWca9PeXhlgPsBugb5eqs9eEciJ9SylrgAGMNPJC17H oNFQ== 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=fOQA8dYGFzWNSbeU/ZKnLzZA3t5DaEY7PF07zCH7DO0=; b=o8RoOcdc4khu6rS+iIjPRyZgW9mESQmAgda1EhzjfBmxBNcBs3rtpvAPYrhimtKwFX b9Mdfej55aAucIqkSWwvGhi8xyBnVMU9LrssoYv/BBcMaPbv/QE5i9AWxd1B4eKmNNiI /wH3sjwUin+3Fw3eGqMlH9Od/vUgY5louN9+kgyBvgpLi8hffazndNBAviT2gfFiI/ZT OdLJY/TVYo5CCVb+GlyXNFFgdiJHiO3lNdjwgMMkawu/ltRmXKiqDRckYzidKRypsb4R /JuvnpUoFlfae2mqNhvEUyXFfZTBtJDSx+CegfAAvzYoS2AZKGUFhjXolrcw1cxL1LLz lCrQ== X-Gm-Message-State: AOAM533fOcu1veGlc9aAduqhFN7ASCH8IoDxcwF+HUeYs+5Tk4ZsmE6q rua85UgaPClz4VwPfrA772cQ+QYOTKQ= X-Google-Smtp-Source: ABdhPJzbTgYskuBpVs+fCBXWMQrAU7YPtLz+26oy2XxEyf4ywGA3/qBnB/lHEBVWZIBE7HBpKW89Jg== X-Received: by 2002:a17:906:a00c:: with SMTP id p12mr12632864ejy.10.1600061314452; Sun, 13 Sep 2020 22:28:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 22:28:34 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 14 Sep 2020 07:27:43 +0200 Message-Id: <20200914052747.124118-20-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 36/40] avcodec/escape130: Cleanup generically on init failure 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" Signed-off-by: Andreas Rheinhardt --- libavcodec/escape130.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c index 1dd7eedd74..a6fda901de 100644 --- a/libavcodec/escape130.c +++ b/libavcodec/escape130.c @@ -128,9 +128,6 @@ static av_cold int escape130_decode_init(AVCodecContext *avctx) s->buf1 = av_malloc(avctx->width * avctx->height * 3 / 2); s->buf2 = av_malloc(avctx->width * avctx->height * 3 / 2); if (!s->old_y_avg || !s->buf1 || !s->buf2) { - av_freep(&s->old_y_avg); - av_freep(&s->buf1); - av_freep(&s->buf2); av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n"); return AVERROR(ENOMEM); } @@ -358,4 +355,5 @@ AVCodec ff_escape130_decoder = { .close = escape130_decode_close, .decode = escape130_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, };