From patchwork Tue Sep 15 07:39:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22402 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 DB0DF442C36 for ; Tue, 15 Sep 2020 10:43:09 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0F6D268BC8B; Tue, 15 Sep 2020 10:40:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2CF0268B9B5 for ; Tue, 15 Sep 2020 10:40:48 +0300 (EEST) Received: by mail-wm1-f67.google.com with SMTP id x23so2307366wmi.3 for ; Tue, 15 Sep 2020 00:40:48 -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=3zXjuHFj3DEPk5MgSZN748+X2V6mIQjei3MNqqZqd4Y=; b=uRt2IjuBATX4vPdrxrZdOqLmlT/9E5g2FdhGaTrcKlYVu6myoXYDXjmHGY4InK6g/Y y5g78AqgMcMdd0dnjkKA0191dwTuUTVYISPUNgVdHbEP41/yoWCFiCL36cspHQkg6O5d SsLHzuE+lynJdBK6Vw4yJuZtSz8q6lBI73YspMQG7O90OAT/vyJznWgWdJE8SJLwIH7a SoJoh3Bzg+MWB7wI3Mh7JbWNUCynxb4dQDA/7QQd6DGq+5ta80YnMmLqIz4/0UbRs2kO OehIPVJnJou8HPv7fXAIjNElxYFR5tzhxCSFQCLTA8xn03KnGAz2mWGKWC07XO8A3P9L vFsA== 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=3zXjuHFj3DEPk5MgSZN748+X2V6mIQjei3MNqqZqd4Y=; b=ofxjZUoPYj6GeG980JDNPpaBzXAKr5vcj+pcXP225rH13KUMiTOeGU4yWroIw4cpos bDgDojYJZDCT0Jfzqq60x/TQFdVutti2FdiCfKpZ23Oug+C19K6xKljmP6mOqFXUTBgV lE9r7MVuuVXEkNHsqU+kt1q3s/peTus8X0/UMnMTvk/2bIUxpnFIRTAQYIZadofx+iEg OTWgI277jjCosPfTFoBkxMv2li0QIa30LHbvOsxvy93gsIVs62GPFi7iXOecDLDI4d/H NsHoBXj4poau537uT9qugPlh1k5W4cdv1Y6y24J9nQDa6t9s3Cctsh1k1eH1k8Nm4x8M wMgA== X-Gm-Message-State: AOAM530qStoXGTvr8LVXn59PYhZwtFlkFAdwQ7oaEZjWLIcCVWufM0gd kAOT1e4rLVcnPZiTbIojciLB4hFOpvg= X-Google-Smtp-Source: ABdhPJxkvNeCoOYtZxEO1NBCdl0ym1/gsgqqPHjUF5J751TxmMcbHxxNNUEhJyngzbAsKV9IG3R2Hw== X-Received: by 2002:a05:600c:28d:: with SMTP id 13mr3164032wmk.69.1600155647345; Tue, 15 Sep 2020 00:40:47 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1fb0f.dynamic.kabel-deutschland.de. [188.193.251.15]) by smtp.gmail.com with ESMTPSA id d23sm6112125wmb.6.2020.09.15.00.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 00:40:46 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 15 Sep 2020 09:39:51 +0200 Message-Id: <20200915074000.102622-21-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200915074000.102622-1-andreas.rheinhardt@gmail.com> References: <20200915074000.102622-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 21/30] avcodec/mobiclip: Fix memleak upon 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" If an error happens during init after an allocation has succeeded, the already allocated data leaked up until now. Fix this by setting the FF_CODEC_CAP_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt --- libavcodec/mobiclip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index 25a7f0ed14..8758e7f617 100644 --- a/libavcodec/mobiclip.c +++ b/libavcodec/mobiclip.c @@ -1436,4 +1436,5 @@ AVCodec ff_mobiclip_decoder = { .flush = mobiclip_flush, .close = mobiclip_close, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, };