From patchwork Fri Oct 11 06:14:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 15696 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 DCE1C448716 for ; Fri, 11 Oct 2019 09:15:07 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CA087689917; Fri, 11 Oct 2019 09:15:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DDA086898D2 for ; Fri, 11 Oct 2019 09:15:01 +0300 (EEST) Received: by mail-pg1-f194.google.com with SMTP id i76so5176229pgc.0 for ; Thu, 10 Oct 2019 23:15:01 -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; bh=O7FPxA949Np/B4sVcCRkY32yHGj3GDRCrlkSALiKR0E=; b=nni1oViWDpU7YT9Jygm7lPbfJvQXycQUV4exUYFEh49h73A+afcr6Yj0i1IyT4Nx3/ Bg5uOnVJjg+/boRgvRRhHyddzqekw93CuvkW628NC6sVvPi6MVXqDxA7OAayyBbg81Pd PyJL+YAAMIH/z0NIUmnnT6k46TSXqesjRrOvy1nyFuZiPvglf6LiY0WUUGSyMwH6Q22q +/hd09OK1IhHxQpAX6agb6utnVWr5sX/MpRTeegYEgHmMCCO4aH8gCUuQ3LL0SK5A8+W K7B6xEVA7aUaFfhbs/sJlUfnDB/7ZnvM8WhSN+uItB+S9VXTuidxt+WCEBSDqR0yWduO OdgA== 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=O7FPxA949Np/B4sVcCRkY32yHGj3GDRCrlkSALiKR0E=; b=NKEciANMlQfV0qrTzbHbfchk4KotvjK+7xAoTFXZVvz27h/eBULbWb76z3icuA3q+e aQk2xQIQEm6Oz9x8JYgb3rsuzuJAEc65uBcF1UbyHM+EvvWBEc1k2ED1HqiwcqGTxULq Iu53CurnDioiKa3Qq5lPhRwzgSbYKdM8kwmbEPXEZnPH3A1EbMvwRqCO6pFz6REw4HCX iFKny4qpqhSjbQE/AQBgo75t+4ufAFdTeCxMffv9SwmNahzZzT51QEkeGwuTqiskZanb ItX+lTmavirV6i0kPt3zodfy9Z+IGI73osDJ17A4GLIrI0h1Z+j7RZsFULNG0GHOPaiK 6ukA== X-Gm-Message-State: APjAAAUMpA39flLYJYfnerbTFBkH1NXe17Jz1Z9wQSyxIiUaEbzWuLlI oQB0Kv/y2vsKc6emKmrKvJ26jw95 X-Google-Smtp-Source: APXvYqyOLl2sHvBOMfUsVQ7AtIg8NRtXRTyznV9AyZ+rarzA5KmiiJIUrkVDD9bGE3i9s2FXYimd6w== X-Received: by 2002:a62:5c85:: with SMTP id q127mr14834617pfb.39.1570774500261; Thu, 10 Oct 2019 23:15:00 -0700 (PDT) Received: from vpn.localdomain ([47.90.99.151]) by smtp.gmail.com with ESMTPSA id l62sm9692707pfl.167.2019.10.10.23.14.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Oct 2019 23:14:59 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 11 Oct 2019 14:14:43 +0800 Message-Id: <20191011061444.4988-5-lance.lmwang@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20191011061444.4988-1-lance.lmwang@gmail.com> References: <20191011061444.4988-1-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v1 5/6] avformat/rl2: use av_freep instead of av_free to avoid invalid access if alloc failed 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rl2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/rl2.c b/libavformat/rl2.c index d847d9aaa8..3d38ffe8ba 100644 --- a/libavformat/rl2.c +++ b/libavformat/rl2.c @@ -163,9 +163,9 @@ static av_cold int rl2_read_header(AVFormatContext *s) chunk_offset = av_malloc(frame_count * sizeof(uint32_t)); if(!chunk_size || !audio_size || !chunk_offset){ - av_free(chunk_size); - av_free(audio_size); - av_free(chunk_offset); + av_freep(&chunk_size); + av_freep(&audio_size); + av_freep(&chunk_offset); return AVERROR(ENOMEM); }