From patchwork Thu Oct 8 13:42:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22755 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 CB36E449BD2 for ; Thu, 8 Oct 2020 16:43:12 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A510A68B8A9; Thu, 8 Oct 2020 16:43:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4134E68B878 for ; Thu, 8 Oct 2020 16:43:06 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id m6so6685188wrn.0 for ; Thu, 08 Oct 2020 06:43:06 -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:mime-version :content-transfer-encoding; bh=3vCT27cHrm9d7rKp3xf6liZngLG0Qysj5soXQVRiaOk=; b=Gz7M0mJR6ps56XSbAK+2AXxNEH3SgGhFAEvDaY0RECvKL5xPJgBId5ogSCPL2kCLSs f2Hg4BOBNEBHBPbwMTxXxEaTg8ivAdDOUBQXl52Ihxf1w1y+yAsLfOo/jUIimziTXqX3 3Xxer2WhCVo68wCUU8AlytCFcibN25RT5AmX9/lZqxz564IIgzC369xX1tzFeESooBm6 P++/61yidLhfQEfwecB5XNmhU4hj6vqjkCbpcqTOQFT658Phy9L92MPUZ5en+9i4nmfm Hbo4dCznrpwXPFXZVbo6MY5vTVqt5V4s4Aq402mbb6Q2PIHlFuHZM8vkuDFpko84j9vM 0Cug== 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:mime-version :content-transfer-encoding; bh=3vCT27cHrm9d7rKp3xf6liZngLG0Qysj5soXQVRiaOk=; b=kYead7pw06WjKgvXzVNCGl3kcGEBb1ksU7TwEgKW/i1hIwtngm82F6CJnZHRlKrbz9 xU9OUF5+yifRekVvY2x1RiUIyyVpxeDdipD8u30RRuW7rIxJNPCt0hR9jy2M3HqeUQyp C1//hcRSzpVIWIK6qDf4i9w3jjJNatylsxLwX0KWSbYp2OlMHtlN+syzK34HvcaiHg/e rXZcxifQ3SAvx6ujn4gVU0VPrNnzztKnH9vlZig1v06/hmw5McNkcC4qvA60Xs1QAoBY kVv4TkNkkiC5D0vJLLZatWREHncYKb+nJ60amLaa2Cc2QZQD/Od9SQ0kQPV/wLeExiOp 73Qw== X-Gm-Message-State: AOAM533QxzGh4mS6/iTaT7KtU8zqLOacOMe/4RDc/Oqw2ivIXE/t1vAa vSCmhl+o4WzRCUGakGbZOtU/DS0qe3E= X-Google-Smtp-Source: ABdhPJyIi3QnnzuSulMswq8eS6jpKzbarqFlhoBM0ySTJ8IiOIbufYh1HuAzwKufeiACcvRiOTIuaA== X-Received: by 2002:adf:d08e:: with SMTP id y14mr7721450wrh.239.1602164585343; Thu, 08 Oct 2020 06:43:05 -0700 (PDT) Received: from sblaptop.fritz.box ([188.193.170.75]) by smtp.gmail.com with ESMTPSA id s185sm7026407wmf.3.2020.10.08.06.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 06:43:04 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 8 Oct 2020 15:42:58 +0200 Message-Id: <20201008134258.13551-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/dashdec: Reset pointer to NULL after freeing it 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" This is currently safe here, because the effective lifetime of adaptionset_lang is parse_manifest_adaptationset() (i.e. the pointer gets overwritten each time on entry to the function and gets freed before exiting the function), but it is nevertheless safer to reset the pointer. Signed-off-by: Andreas Rheinhardt --- libavformat/dashdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 42ea74635b..c28bb07f44 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -1146,6 +1146,7 @@ static int parse_manifest_adaptationset(AVFormatContext *s, const char *url, err: xmlFree(c->adaptionset_lang); + c->adaptionset_lang = NULL; return ret; }