From patchwork Tue Oct 3 13:15:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wm4 X-Patchwork-Id: 5395 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.61.8 with SMTP id n8csp2709992jan; Tue, 3 Oct 2017 06:20:44 -0700 (PDT) X-Received: by 10.28.144.206 with SMTP id s197mr14909953wmd.142.1507036844599; Tue, 03 Oct 2017 06:20:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507036844; cv=none; d=google.com; s=arc-20160816; b=weLspX3a0NPdS13JTLIL5y312IHRx1c4570JSpTjtFcP6XT+Hp1HsKcw7IX8mRvQLE q05rtJyumKdbhU9i/Jez+38N7ONqdt4XSvav6X23EdZQng8VTFYzoUojMTj0qEbBgDy1 FglNp4BfKS+Y1luxm378nuuxV5fvdtQjGXFLUmmIAY1UsHTgUNg/XXvfFOKnVpwvX3ly Qs6ng/vnkwqCbK02uhp41cerQsoMT1+ky8qdYd+1NQN8G0Z3aPexKkylOkGLyXf1d7jK QuMTudfd15G3NOosI9lRHlS+e7NQ0ar0r0rUgbFzy+S6r+4i20aK07jigfIiKAHMjE5t fHAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=o7xYJEgNiWVzYOFoeH4rFOuTqryWwc5Aubz15evjUkk=; b=y0sJkKOxGBzaUb5x9KKrichV/buupyemIXTgWCOr4Za34LI7urmoGDeeBb+TKXSn6c jA12SL8u5hNpHAmzbY8ppcBmuBRHY1ogA2XtCFu9ocaSThgZb0ohPX4sHbHwBQJhMW0o 2w7gkpy/QvZ39c/rwqYyUgQpv0+4D09G3cZf3VGhoBBNcia7dC2kQbC2v6BCjM3BgHZB lAYn6jxjX9yg9ExNDYE06cVe1QFnv08/mlGLIKGCgxaQTllAdskSrPv4JgqBosZSRuek OthBFzXPMA8jyICUOXpL5jYBZzv6bEO8EO/w6y4ZI3wCSAByGf4qCDxUziIiP/8L6wWh zOKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@googlemail.com header.s=20161025 header.b=kOtzDscT; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 68si10141069wmw.88.2017.10.03.06.20.44; Tue, 03 Oct 2017 06:20:44 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@googlemail.com header.s=20161025 header.b=kOtzDscT; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0828D689FEB; Tue, 3 Oct 2017 16:20:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 14950689EFF for ; Tue, 3 Oct 2017 16:20:15 +0300 (EEST) Received: by mail-lf0-f47.google.com with SMTP id m142so5869632lfg.8 for ; Tue, 03 Oct 2017 06:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iu8r4/e7gwgh6ndGejp5hdidx5qVG2M3n3ShPkFIcxY=; b=kOtzDscTo/K9rXaXh9w+BEzAGzN01A4iORMnOf7ZAVTEnLwj+2xB/SIXwIlGPSqSsq M/UyaC22fjDMXzilBPbwNUMqA+VK7qI+uua8SS0OFJq55zpk6ebrZR3pOFbERQ1gXJkR bw4wIIpLNhYDRpHfNZbfplagYGi6NmIlFt9Ue1MBx1hRq5lssY+72WuyAYLdVs99Hcf0 5R9kNB668rJAjjov6G3TJrcctHFiF2Xots/9MezyFF0FonZiGJLCv0s5++0wnWwW5I6R 0tDEiQSFcrdwP8Ch7XP6OGTUVDNOlY8uNKTrE8J3DhM5Lg0BnyrWwNydRA87S/ydGlZf VZ1w== 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; bh=iu8r4/e7gwgh6ndGejp5hdidx5qVG2M3n3ShPkFIcxY=; b=NlHolap3HFW4nojr/XNcopLohs56dPrwz2fNDLJnOe3eBLgHzGZKq7M8pf1aaKAxjd hLxHguo+MOw5gCtk23lZnUMLZ1vthRZdznmtAWoON/yLI8VztLJ7MUkPxyP1uBXPXha6 0DKZMCVVj8tqyiTh0s8PoisPKPDz3jRMZnzUTIZuMN8DsDsqV1/bMHmu0m9orOq7/Hzc X8hv+yXob9RadFI90gw8v0u3E/uacollChWhqFgK73R8vF95zyc9D6/EoFz7MqyTR/4Y /6MePTAyUQxmtioM7UMZNwnPslN6HSxkUoq9kwzQ4EYG8QS/vQeIs2QfKwei8AALp2/J +tRQ== X-Gm-Message-State: AHPjjUi0BiNjtHTQe05joKb7ouU9dEWJXrspqniKGBBFm2VFYSiW3J8H Vp3YQ9+TLk52eElXHtOj10uw6w== X-Google-Smtp-Source: AOwi7QDxib+UpFL7INOamN1WmsObezV2Jal8WM5V49kDaNUD3E0AqiPgKV/n9YRgV2GNPQLkkofoJA== X-Received: by 10.46.67.87 with SMTP id q84mr8691389lja.73.1507036496279; Tue, 03 Oct 2017 06:14:56 -0700 (PDT) Received: from debian.speedport.ip (p2003006CCD5CDB6820D8428BCA02F6C5.dip0.t-ipconnect.de. [2003:6c:cd5c:db68:20d8:428b:ca02:f6c5]) by smtp.googlemail.com with ESMTPSA id 6sm2892024lju.45.2017.10.03.06.14.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 06:14:55 -0700 (PDT) From: wm4 To: ffmpeg-devel@ffmpeg.org Date: Tue, 3 Oct 2017 15:15:12 +0200 Message-Id: <20171003131518.4557-2-nfxjfg@googlemail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171003131518.4557-1-nfxjfg@googlemail.com> References: <20171003131518.4557-1-nfxjfg@googlemail.com> Subject: [FFmpeg-devel] [PATCH 1/7] decode: avoid leaks on failure in ff_get_buffer() 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: libav-stable@libav.org MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Anton Khirnov If the get_buffer() call fails, the frame might have some side data already set. Make sure it gets freed. CC: libav-stable@libav.org Merges Libav commit de77671438c24ffea93398c8dc885d4dd04477de. --- libavcodec/decode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 1337ffb527..437b848248 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1658,6 +1658,9 @@ end: frame->height = avctx->height; } + if (ret < 0) + av_frame_unref(frame); + return ret; }