From patchwork Sat Jul 11 18:20:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 20967 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 3FC934491AA for ; Sat, 11 Jul 2020 21:21:00 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0CB56688105; Sat, 11 Jul 2020 21:21:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from btbn.de (btbn.de [5.9.118.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0A531687F68 for ; Sat, 11 Jul 2020 21:20:54 +0300 (EEST) Received: from Kryux.localdomain (muedsl-82-207-209-226.citykom.de [82.207.209.226]) by btbn.de (Postfix) with ESMTPSA id 3E775E9D1E; Sat, 11 Jul 2020 20:20:53 +0200 (CEST) From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Sat, 11 Jul 2020 20:20:42 +0200 Message-Id: <20200711182042.22894-1-timo@rothenpieler.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] tools/coverity: override av_dict_set 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: Timo Rothenpieler Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Coverity thinks av_dict_set frees the key and value parameter, because it has the (rarely used) option to do so, and it's not smart enough to figure out it depends on the flags parameter. So lets provide a custom implementation that does not free them. --- tools/coverity.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/coverity.c b/tools/coverity.c index 19a132a976..5e4eb19f39 100644 --- a/tools/coverity.c +++ b/tools/coverity.c @@ -77,3 +77,12 @@ void *av_free(void *ptr) { __coverity_mark_as_afm_freed__(ptr, "av_free"); } +int av_dict_set(void **pm, const char *key, const char *value, int flags) { + int has_memory; + if (has_memory) { + return 0; + } else { + return -1; + } +} +