From patchwork Mon Sep 16 15:54:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 15102 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 20323448C5D for ; Mon, 16 Sep 2019 19:03:35 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0493A688188; Mon, 16 Sep 2019 19:03:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A4071680BC2 for ; Mon, 16 Sep 2019 19:03:28 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id r5so5525389wrm.12 for ; Mon, 16 Sep 2019 09:03:28 -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=pUZZB1xVYJXlEeTgDNyM/zHZoDxNSF7V/iEOJPXeSRo=; b=gWQXcO4Ahfav8R4BdvbJwKb6qpmFfF02F/o9Cnylr4B0QkrQU/8X8OWPW9VD/P7fTh A/dtw0Sg+uNGHEqiJ+ASIuNrKa2ny5c8ecF+pJdvcAa3hZVZav1AHSpIs4x9ts03d/4J QCr7uePo/NkaBds694TujdOtQMsA4gi36GpR0wUoHecbk2eSeLtz5YeJ84rtS+iB1/Si wYhhOmiK51EPQoLhNUy2t1oKPsrn3oDcjtDwiUlyofOw8Vfd+K2zogzVn303stWYvAe6 pm3cgV6EL5GFn4NWW3tBUjqTV+s03dd+Un17LHd1YblstPKwhOrS2PJIeVS7kp1dlhtC XHxA== 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=pUZZB1xVYJXlEeTgDNyM/zHZoDxNSF7V/iEOJPXeSRo=; b=LhuUvEO+ibqRy2W4bCTxrYuMCoZ4PRzZ5F+3eRyv7Jg5juBOCwXDPEhBLUf2BnYUvX AQXb42Xi8kCM/jG/xsVl8J0mVJe8RdQUehA01L3NTjZu5lEa8xVps3JoBJljEk8NHTPt 5faq/lQLxufUS6b67ShPHN+nauiP3Z4jkwgG+FC9EypRpsUJ2y0iA+kr81xNBI/XDF/Q IrtLTTrISsiQrtvkXKgt5xsWgxSQHK7XpBdg3d0GOO6dymOqTgZLEc+wRKXuYQwJ34R8 fZSOYSe2EIQEeyHcc6wSPTrRSn/3psFvvInKFSbe7AbAWnt8R9PGmLP6SN1uqh0W4rWr 6QDg== X-Gm-Message-State: APjAAAWmHT1LwpnLGNG+rQC/985Bt6sQXyY5Lf2r29yEPVbDvB2fjGTT LiSA9yiGkPhNl1oGQR86pWJXo+ua/8M= X-Google-Smtp-Source: APXvYqzhrAQSMUp6/jLZl8/0zqxOTX4WDINjJANNTuEDUgrrF7mvz8WPiao8i6h7woyryx1srCJp/Q== X-Received: by 2002:a5d:66d2:: with SMTP id k18mr425982wrw.7.1568649808028; Mon, 16 Sep 2019 09:03:28 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc0f857.dynamic.kabel-deutschland.de. [188.192.248.87]) by smtp.gmail.com with ESMTPSA id d28sm48111628wrb.95.2019.09.16.09.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 09:03:27 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 16 Sep 2019 17:54:59 +0200 Message-Id: <20190916155502.17579-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190916155502.17579-1-andreas.rheinhardt@gmail.com> References: <20190916155502.17579-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/5] avformat/mov: Fix memleak 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" When the mov/mp4 demuxer encounters an error during decrypting a packet, it returns the error, yet doesn't free the packet, so that the packet leaks. This has been fixed in this commit. Fixes the memleaks from ticket #8150. Signed-off-by: Andreas Rheinhardt --- This only fixes the memleaks from #8150. I can't reproduce the uninitialized reads, so I can't do anything about them. Can someone else reproduce them? libavformat/mov.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 675b915906..cd3f5bffcf 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7843,8 +7843,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) aax_filter(pkt->data, pkt->size, mov); ret = cenc_filter(mov, st, sc, pkt, current_index); - if (ret < 0) + if (ret < 0) { + av_packet_unref(pkt); return ret; + } return 0; }