From patchwork Wed Feb 15 23:56:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 2570 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp2213750vsb; Wed, 15 Feb 2017 15:56:50 -0800 (PST) X-Received: by 10.28.135.82 with SMTP id j79mr9757286wmd.19.1487203010282; Wed, 15 Feb 2017 15:56:50 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 31si6933031wrj.324.2017.02.15.15.56.49; Wed, 15 Feb 2017 15:56:50 -0800 (PST) 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; 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 357CB689A34; Thu, 16 Feb 2017 01:56:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 01BD268799F for ; Thu, 16 Feb 2017 01:56:34 +0200 (EET) Received: by mail-wm0-f67.google.com with SMTP id v77so721448wmv.0 for ; Wed, 15 Feb 2017 15:56:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=kEVc0xUMJ17hb2aHmzuVyLGL90Sackyd7zk6GZb7Rz8=; b=pD/TtNWi8ncdMSLCnuQkcWqrQ13HNPcucsb+L0Nlml/9d5w+K6Z5tkqnDGRsjmwZZy B1KPA1+OXCoqQbYKnwwJBRGJMAneZEwjtcVsix1+SV9wdafGQT/X53SBYoXpPY3Zww51 jKzrGUznXOQJNMw7zM6yNtoPY8B7jiPNposx6EqRhTO36GX19PAD5jvdq2Sh/BKg7r/U jiMrVooORfZyOw0xsCjusnphe4Pxv2lE0ugwe3BFd7RUjLhG6SlAteuRXDIWEt8aYATH RKt0YFn98Bvxx7DBZQTiZ2aoNUcpDM3KVReD6p96zPG+t/qRRNNElBJ1/b4AgmdcO5GV JcdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=kEVc0xUMJ17hb2aHmzuVyLGL90Sackyd7zk6GZb7Rz8=; b=hYp7cRi63iw/e3bKhTkLJyerS5d9FYlOSWV6txBoDhatEgqEoKPoGwcWJrmcT6ZoVm z/wqnghFx6GBhHiSwngMOSbGZpsmrgrHzzUnVSaS/coW6Y295b3igKp2+rZ0oyLryP5P tCmkq8X3i5wQwAejLZ6IMiIwpMSGBUo9JBu2YjjSffMM7gShlrJzM6iIngnPcnlyz8ea hvieh2li2b/O+/lS+wZ2imx6S0z2IQTqgtRyCHlxx5iYMdIqPHaBVcxvcdb97vqKQjYH RVQ3h588RDenCvXINxrNjAj7iRq+tOvmSTFe1GmCnEf4aSo4O7QAeUuyq57JfC5TdSTs omsg== X-Gm-Message-State: AMke39niKNssnGSVgzreByvAAQb/CM9pjHt8blvJ13qokOp0P33QbKDNko80/ln6+fQW+w== X-Received: by 10.28.0.2 with SMTP id 2mr10352304wma.141.1487203000369; Wed, 15 Feb 2017 15:56:40 -0800 (PST) Received: from [192.168.2.21] (pD9E8E0AE.dip0.t-ipconnect.de. [217.232.224.174]) by smtp.googlemail.com with ESMTPSA id n18sm6566593wra.64.2017.02.15.15.56.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Feb 2017 15:56:39 -0800 (PST) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: FFmpeg development discussions and patches Message-ID: <8450fd05-8f25-bcb1-ad94-0b44b096c34d@googlemail.com> Date: Thu, 16 Feb 2017 00:56:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] wmaprodec: fix leaking fdsp on init 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Cadhalpun --- libavcodec/wmaprodec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 4d530264df..1ad1e23541 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -323,9 +323,6 @@ static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx) } s->avctx = avctx; - s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); - if (!s->fdsp) - return AVERROR(ENOMEM); init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE); @@ -523,6 +520,10 @@ static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx) } } + s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); + if (!s->fdsp) + return AVERROR(ENOMEM); + /** init MDCT, FIXME: only init needed sizes */ for (i = 0; i < WMAPRO_BLOCK_SIZES; i++) ff_mdct_init(&s->mdct_ctx[i], WMAPRO_BLOCK_MIN_BITS+1+i, 1,