From patchwork Tue Sep 15 07:39:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22390 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 52D7E44B636 for ; Tue, 15 Sep 2020 10:40:43 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3E57E68BC39; Tue, 15 Sep 2020 10:40:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 188CE68B77C for ; Tue, 15 Sep 2020 10:40:34 +0300 (EEST) Received: by mail-wr1-f67.google.com with SMTP id w5so2149522wrp.8 for ; Tue, 15 Sep 2020 00:40:34 -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=dYGsTXoGrRHPvIg/xrF2jFFrEatYPsMp6SlicXLt20E=; b=Sbof3qwGUMaDwb+kovztO/s5MZFOyd/CAaQ8JSHa89JQVs4prVywuFwdg0Wo5Detu3 pinzLAXoGGRSBxY8DZuYjPZH3yNAs39n1Y65vMTTE1atu5SWMnzpCr9tC0i8ZIkugq33 yG1S/jEkpVjJVseiXS0UvP7A/8WrHChnUCKOhAqjlK7Ghmt/QuU1kVuDN5AK22sykAZB Z+3+ZrXEjVZFLEvn/kgG50moaJ3oMg4wWlUyvPKnTTmcflcDM6t8iLsECXRag+cTvYG+ VnsSEgEzgGFV61zCgASNdAtfeftygPeXjN4XoNzOXIkyYWrBjh+ieG+WdzSNS9AxbTWy ytYw== 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=dYGsTXoGrRHPvIg/xrF2jFFrEatYPsMp6SlicXLt20E=; b=RIvOx1xQs9SzH/Se74iSS/ixUdHHzSZuIm7TrSuBgPjzyZRy4/3IvGhDK5LB8RwikC Sis2SbPWXjE0CtvX+YE74ueUagPRBGcDPewUvBAF7U9zptQ8C9B1rVsJUn63Yddd54a6 /ehAbblE+G56F+hKFMh+zCF1MW574DhfEbwfR42O/3XdEAdzrNGfN1QCObw3ToQBgDfB EvN/HxKTJzENfSPSyJ5A7IfJXzXetcNbF0qCBwhizxJ4gLQ6WkfhXcU226VoK2xgVCIQ Ux3Vl2IbRnIGQyLflWJh44uqG/Zo1Cq5fZfU+H4vl5cJUQGqAHrrjrS44nAVFl24wR+3 BGcg== X-Gm-Message-State: AOAM530ME4UGFOI5b1VW1zaWgcXIYI3Sb/N0Y7ZdLIaZ+pgkJ/aPpgrX VETa6DclpsBxSWhSgnu297ByoHT3/MY= X-Google-Smtp-Source: ABdhPJz+zOFDcv92On1mNHs8VNp/QrqIJgjJn7XI/6E1M7XPJd4RMMlxiFtHoTSW4ubaeCIevs7Y/Q== X-Received: by 2002:adf:9e06:: with SMTP id u6mr20160614wre.208.1600155633356; Tue, 15 Sep 2020 00:40:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 00:40:32 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 15 Sep 2020 09:39:37 +0200 Message-Id: <20200915074000.102622-7-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 07/30] avcodec/gif: Fix leaks upon allocation error 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 one of several allocations the gif encoder performs in its init function fails, the successfull allocations leak. Fix this by adding the FF_CODEC_CAP_INIT_CLEANUP. Signed-off-by: Andreas Rheinhardt --- libavcodec/gif.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/gif.c b/libavcodec/gif.c index 65a76cfde4..de41992851 100644 --- a/libavcodec/gif.c +++ b/libavcodec/gif.c @@ -497,4 +497,5 @@ AVCodec ff_gif_encoder = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE }, .priv_class = &gif_class, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, };