From patchwork Mon Nov 11 01:12:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 16201 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 A69EC44828C for ; Mon, 11 Nov 2019 03:13:18 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9172768AC8C; Mon, 11 Nov 2019 03:13:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6F7686883D3 for ; Mon, 11 Nov 2019 03:13:11 +0200 (EET) Received: by mail-wm1-f65.google.com with SMTP id z19so11536004wmk.3 for ; Sun, 10 Nov 2019 17:13:11 -0800 (PST) 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=vpP0LA2++alASW/7c085LUZ2DyYn5b0nlCiRQXOAnxc=; b=hRTMj4KdAln9/+Jl85yVDqPLAdYs7kPK34R+mn4D4HGwvsLww4y4KdNt3ogwPUA/8+ WcnH59kn8bf2kgI8u1p3bpWgmcHbVfohcFzx4/3PVGKmog+ZIjibqWLZ44vze+OEBsGx F9YYwy4CBRt/9gXe3GTreJCsBNW/Zc1KYfd/bIlSRIzs2iWSQLD0tjI9R6E3s75rtS71 kT0lur/TEr3/joZ0/wW6dCr7NiwcDh4He+yClCHzVuevLcvcGk90srBkR5ECQTgbM5Se rxLoEH7jvc/hSB2qmO+529JJAVF/LfdwaSxB9srbZ83DPvyqUS1rRMOi+scH4GYwxfr7 RsSg== 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=vpP0LA2++alASW/7c085LUZ2DyYn5b0nlCiRQXOAnxc=; b=VbkIjs3T88vSNj0qL5zMoq8Br+0XKr8j+Q/xWiRp7rRUilN+2fYC/2Wtth0ahSGzoN HfLnSIFc07YQMChtFK41UmtXzVKCmWjxJboNKxC8PUtt98vMtc2q9Qn+IqRWmn5rgRtf AsRnQ9QXqhEuodb3aL0YRBkTRcXcKG2XfSLuwpJ5Csqdv+v25eonxorPOkHsUWplU7FJ Um6iAg4rPN3yFtRn0Hl7zJRROJtkNIRwlGLnp2ZhvSuEt9f2YJBh5STb2KqV6zumU4a2 t4M5UL8/IJzsFh0/fXkN7ML6DGENxdhdbUbVzxReeqCz4AnpmerqC+lfTxSbYaQdJkBK FUUA== X-Gm-Message-State: APjAAAVHMOovCiVZmxxHVLAYBP60kHxcyb0bP7IM1fSK7tcppSK+OPRa iF+Xb0KMfJKHFNJcAfo6PTlbGrGt X-Google-Smtp-Source: APXvYqxPI4Dhy6T+AUaXWY/fcFlTOJ3RAgGRlQ0EfQk4gu5BwUkVdHiXFR1y76VT1dVZACt3lQPmYA== X-Received: by 2002:a1c:1d41:: with SMTP id d62mr17612882wmd.32.1573434790859; Sun, 10 Nov 2019 17:13:10 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc08937.dynamic.kabel-deutschland.de. [188.192.137.55]) by smtp.gmail.com with ESMTPSA id c24sm33717357wrb.27.2019.11.10.17.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Nov 2019 17:13:10 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Nov 2019 02:12:58 +0100 Message-Id: <20191111011259.27313-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191110035406.11500-1-andreas.rheinhardt@gmail.com> References: <20191110035406.11500-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/11] avformat/oggparsevorbis: Use AV_DICT_DONT_STRDUP_VAL to avoid av_strdup 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 will likely also fix CID 1452427, a false positive resulting from Coverity thinking that av_dict_set() automatically frees its key and value parameters (even without the AV_DICT_DONT_STRDUP_* flags). (AV_DICT_APPEND and AV_DICT_DONT_STRDUP_VAL are compatible with each other since a8c5b455, so we can reset this flag here. It has originally been removed in 0dc66553 when appending was added.) Signed-off-by: Andreas Rheinhardt --- libavformat/oggparsevorbis.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 43f05f928a..8dd27e7770 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -177,9 +177,8 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m, av_dict_set(m, tt, ";", AV_DICT_APPEND); } av_dict_set(m, tt, ct, - AV_DICT_DONT_STRDUP_KEY | + AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL | AV_DICT_APPEND); - av_freep(&ct); } } }