From patchwork Sat Sep 19 16:35:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22496 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 2215E44A83E for ; Sat, 19 Sep 2020 19:37:36 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0DEFC68B814; Sat, 19 Sep 2020 19:37:36 +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 C0C3E68B75D for ; Sat, 19 Sep 2020 19:37:22 +0300 (EEST) Received: by mail-wr1-f67.google.com with SMTP id a17so8572086wrn.6 for ; Sat, 19 Sep 2020 09:37:22 -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=ssF3cZ0a1CS5lS0UqC81ViBmIKfioVA0oMGTBYquOqU=; b=Jx0/9LlKJc7zvGb/1rTu7Al0YwqcOFNJpRaaoPKgHl8YzEoBsYgKVolb4zGfEGna5W SYTAqsUC+9d/xFzmAHyqtF82HiOxDGl66/KeId93rzyHapykT1JKghaLq2HHcFmLpRux nXTuKdqxOT/Qv2v/xe+S78qUkEUf5BkikrWsEqai/Mm1ZbGPv1b8rQppR3tdnaDC8fOz 6p+LJKUdVMX29FtjX9Sz5f6kSt3N0dEUk9WgIxqAsItrV9U6DpHlHgj9ULpE3sN/kAhL 2q2eKAc/qQTf1XzLSEElKfyQs8n312XiomkPi7zQ+AOp9YxVPlAQ8LrV2GGdjFhUGvBK 95nQ== 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=ssF3cZ0a1CS5lS0UqC81ViBmIKfioVA0oMGTBYquOqU=; b=ZS8KKeeDCJ95twGd+PlYg9xkl5NZOs2TNicfXv9UMA8W0jay+QwC/F7vPBLyBU2OLm uhLhYtmneWl0PscIcRb6SzWi/P7Qco4UoKmzA0FzCNiqJY9xSOU2upWl6mOMdjIZTKMo dZWH/SxB20FibshXxnZxpLpX3EKnRv7YTdwaNzBg3cJzaQRYjAfrvmQTBkSo5Kc5Gj28 E/hBmLzmfgEJkwfimkcWKJyNis2ekRpbzgDpFRjq0FdUprokrL7D1aD8/M6JXF1/M7uX X0H5pXv2JoEqrxyilWBMgBt5yfW2Mj12dxTDbBg/zLIJkZd3BgcvYPh+GCsAxAbWDFq+ lE2Q== X-Gm-Message-State: AOAM533VTt5UxE3gUoXLKEZDrat0WpjRNX2W7NVO2axVYroI3VDJa0Ff S7KSOBcoujlIrsQLQ33qOu5RxvOytBU= X-Google-Smtp-Source: ABdhPJwtO7hkuKqKHGC4BdhudaCbudOqwERkfsMYGickDN9ztuNvTdQYKjrDLO/ShYlLXPAYgOutMA== X-Received: by 2002:adf:dfc9:: with SMTP id q9mr19511436wrn.400.1600533442008; Sat, 19 Sep 2020 09:37:22 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1fb0f.dynamic.kabel-deutschland.de. [188.193.251.15]) by smtp.gmail.com with ESMTPSA id d5sm12451137wrb.28.2020.09.19.09.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 09:37:21 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 19 Sep 2020 18:35:59 +0200 Message-Id: <20200919163610.1099233-10-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200919163610.1099233-1-andreas.rheinhardt@gmail.com> References: <20200919163610.1099233-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/21] avformat/dashdec: Fix memleaks upon read_header 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 --- Making sure that it's safe to call this demuxer's read_close function upon read_header failure was of course the initial rationale behind this patchset. libavformat/dashdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 4f87ef981b..311a19e425 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -2047,6 +2047,7 @@ static int copy_init_section(struct representation *rep_dest, struct representat return 0; } +static int dash_close(AVFormatContext *s); static int dash_read_header(AVFormatContext *s) { @@ -2178,6 +2179,7 @@ static int dash_read_header(AVFormatContext *s) return 0; fail: + dash_close(s); return ret; }