Message ID | 20200614223656.21338-13-andreas.rheinhardt@gmail.com |
---|---|
State | Accepted |
Commit | a5ed8aeea4f4199e89520c3fdbd9d07ae7fc3c3f |
Headers | show
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> 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 EE9C7449042 for <patchwork@ffaux-bg.ffmpeg.org>; Mon, 15 Jun 2020 01:38:56 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D407668B503; Mon, 15 Jun 2020 01:38:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1E73368B20F for <ffmpeg-devel@ffmpeg.org>; Mon, 15 Jun 2020 01:38:55 +0300 (EEST) Received: by mail-wm1-f65.google.com with SMTP id j198so12856651wmj.0 for <ffmpeg-devel@ffmpeg.org>; Sun, 14 Jun 2020 15:38:55 -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=RJwPUW5P9snf4NdVuTxUN1oweJjRhrCw77O1O6x5AYM=; b=gCDGYF81hED7KFB0VcfIUg3dggDdakriczCfSOAyFeEX+Z7rWGgFObPi7JZ/hsjVdj 0kJ6ku+WwjqXyKWMu6A3BPJkvOMg6PLMtSRKpt87rZSuZ9hwSBJrm//8tq57YKM0O942 sUEYpIuSe8F0++fjNJFS1Rb+FgyF9IzUmjwbet9IuIl4r92Qv5GD+WJs9j6Ogmsyix6a +nAtJ/WOrtC0ZxndJPIDaJ6XUp8VFgZ41Uj5egTVZBnv5V093JrkxHxvaW1kSqZgO9CC qyuOuq+iAgNVXmZE07uZQeP9ykWTudNFz9LC1wDquoFKVuVOzDMHRdeMB3XjHf0/fEG/ Ux7Q== 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=RJwPUW5P9snf4NdVuTxUN1oweJjRhrCw77O1O6x5AYM=; b=JYCYmF/+4OP2Onx/2flvYhTpXq72STPnvuXwZ7c0t/uKjH+jEI6Ev9znbYFKPfxelp OGHTD2diPpG0GqA2vjU1TWW0VE8/F7apBGSQIPvczMmuhS5HNYUILgIlvjKs3riBI1Mb utWgnvQyUz5PVKurKXqlOUzyVJF0+etx/tBK53zmsNIumR1thP2euH5CIO0IwFmVtTcs iViQPTFaBZ0M7n4JbMO+9K7BXeSK6czgMqTWmeqeZ18Z2RP/T6/Y8MTX7jIEcc9WQB3V byRqSAd/lapQ7gQQBbgmnmyNUQkECyti3p9/okjy1q/vKrEYdKbhmlMT2tVU6q66QC+d Gmaw== X-Gm-Message-State: AOAM533dOAYFeeEmk1/JPrRUy0nfxEj9CZe8qrum707AJksNTIBxcPq4 ZcO4w4bXkRz6d7hxxsZbuC8dCpEo X-Google-Smtp-Source: ABdhPJxJV9usOtMsxUtpET7OKDZJXFDy0AJLo3YrOToR/NXrVchJpskOatecnnwxeSd7Tyl0IMNGEg== X-Received: by 2002:a05:600c:645:: with SMTP id p5mr9752062wmm.156.1592174334333; Sun, 14 Jun 2020 15:38:54 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id z8sm21491034wru.33.2020.06.14.15.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2020 15:38:53 -0700 (PDT) From: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> To: ffmpeg-devel@ffmpeg.org Date: Mon, 15 Jun 2020 00:36:43 +0200 Message-Id: <20200614223656.21338-13-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200614223656.21338-1-andreas.rheinhardt@gmail.com> References: <20200614223656.21338-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/26] avformat/mpsubdec: Fix memleak 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 <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> |
Series |
[FFmpeg-devel,01/26] avformat/matroskadec: Move AVBufferRef instead of copying, fix memleak
|
expand
|
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c index 82c73457ea..e7b83a1d85 100644 --- a/libavformat/mpsubdec.c +++ b/libavformat/mpsubdec.c @@ -154,8 +154,10 @@ static int mpsub_read_header(AVFormatContext *s) } st = avformat_new_stream(s, NULL); - if (!st) - return AVERROR(ENOMEM); + if (!st) { + res = AVERROR(ENOMEM); + goto end; + } avpriv_set_pts_info(st, 64, pts_info.den, pts_info.num); st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codecpar->codec_id = AV_CODEC_ID_TEXT;
The already parsed subtitles (contained in an FFDemuxSubtitlesQueue) would leak if an error happened upon creating an AVStream. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavformat/mpsubdec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)