From patchwork Sun Jun 14 22:36:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 20361 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 30881449042 for ; Mon, 15 Jun 2020 01:38:47 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1B27968B670; Mon, 15 Jun 2020 01:38:47 +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 1F53468B5D0 for ; Mon, 15 Jun 2020 01:38:45 +0300 (EEST) Received: by mail-wm1-f65.google.com with SMTP id d128so12970666wmc.1 for ; Sun, 14 Jun 2020 15:38:45 -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=1EtFVdzjOjOTYub/CS7S9hOGHZHE9OyLSjB6w13uuy8=; b=NYlYi0crNiz4g6fi5xL+0HEunxqJpXFrv9q0iS2PlRJJa6R+eG4YwFi0TlV2ow6Cmb 7xcV5rDIB61dfhj50pyuFKFu1v3ybf0Dfr5vBC+fWYdtNhP2bfX7VeXjQU+lMcGJ8SoG xFmsCl2zqGG7PGXquaJIory7TVLWrLm4uSp2FkwbNNcvGn1YhpTogLxZh+BUHOVWRmAk HY3yguBubjSUP9fDfYfcD2xkTK4fmafshvRbaPD1fUPf627/lQSHeVvjlNNX/n+CW453 qWvpTYuzixk3hoZ6g1ndPtfSX1AVfWLwFIBUbnki3sLlMmXiGKk3l3aSimkilDhtgBoI QJ2w== 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=1EtFVdzjOjOTYub/CS7S9hOGHZHE9OyLSjB6w13uuy8=; b=uFcdvac7sbleQx2hC3U4D/HlrOiKRe9uu9KeVhP4clXRoJG/H+0P0p2B7xw98QQDTH +yNp+JMPugswy0ny5gpGU6sylkCcSdvCZGe0TiJdZv8cfO5rZnTWHYDSswl0NuyCI5OH 0wxpEuVevtdpJtyWUceeaXoPD18m5VHGs8onEfYO8DX2eguLhKFaYPhB/W6q4Y+q5fuV VQGQ31K2QN7dpGD372AuVztv65/+PX/0yS52RuUUx+BXR1TtJ9SGLhHWDGKXvnw5vnoa zi10yctJP+l3E1dM9kCnbhGsd8a+VuUTzcZ8o1U3RErlQpWeSaHf93e5lnTBlyzMKHz2 12BQ== X-Gm-Message-State: AOAM5333Czs8RIf/cfOzl7haHFuGxxCy4HLIQtITyJkNE8a5rwtN585Q f4zJFqRglv0M9s4L3VOU96JxYwwo X-Google-Smtp-Source: ABdhPJxNAAGFWkWcaplnLxKT6TZ0ZqK/KhDKskf+Ml8coQbOcHZkOCPzX2qP+hB0Mb8hTQohLAwmgg== X-Received: by 2002:a1c:9d96:: with SMTP id g144mr9622142wme.126.1592174324258; Sun, 14 Jun 2020 15:38:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2020 15:38:43 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 15 Jun 2020 00:36:40 +0200 Message-Id: <20200614223656.21338-10-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 10/26] avformat/lrcdec: 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 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" The already parsed subtitles (contained in an FFDemuxSubtitlesQueue) would leak if an error happened upon reading a subsequent subtitle. Signed-off-by: Andreas Rheinhardt --- libavformat/lrcdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/lrcdec.c b/libavformat/lrcdec.c index a9a117691a..46d5e2bc6a 100644 --- a/libavformat/lrcdec.c +++ b/libavformat/lrcdec.c @@ -202,6 +202,7 @@ static int lrc_read_header(AVFormatContext *s) sub = ff_subtitles_queue_insert(&lrc->q, line.str + ts_strlength, line.len - ts_strlength, 0); if(!sub) { + ff_subtitles_queue_clean(&lrc->q); return AVERROR(ENOMEM); } sub->pos = pos;