From patchwork Mon Jan 4 18:11:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AlexisWilke X-Patchwork-Id: 24787 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 5221844B37C for ; Mon, 4 Jan 2021 20:12:05 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 28B9668A82A; Mon, 4 Jan 2021 20:12:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from m2osw.com (m2osw.com [138.197.205.139]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C8B0689A63 for ; Mon, 4 Jan 2021 20:11:58 +0200 (EET) Received: from monster.m2osw.com (96-67-192-225-static.hfc.comcastbusiness.net [96.67.192.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by m2osw.com (Postfix) with ESMTPS id 846933E8FF; Mon, 4 Jan 2021 18:11:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.1 m2osw.com 846933E8FF Authentication-Results: mail.m2osw.com; dmarc=fail header.from=m2osw.com Received: by monster.m2osw.com (Postfix, from userid 1000) id 05D2E43C00A1; Mon, 4 Jan 2021 10:11:53 -0800 (PST) From: AlexisWilke To: ffmpeg-devel@ffmpeg.org Date: Mon, 4 Jan 2021 10:11:00 -0800 Message-Id: <20210104181101.62248-1-alexis@m2osw.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 0/1] bug: test pointer to be used. 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: AlexisWilke MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" It looks like the if() and the following lines disagree on the pointer to be used. I would imagine that these have been tested so the: f = indev_list[i - size]; and f = outdev_list[i - size]; are most certainly right, meaning that what's is wrong would be the condition on the line prior. There is another location in that same file where a similar test is used and the if() & following access use the same pointer. A proper test should call avpriv_register_devices() four times: with both pointers set to NULL, both pointers not set to NULL, and twice with one of the pointers set to NULL. That would allow you to verify this fix properly. AlexisWilke (1): bug: test pointer to be used. libavformat/allformats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)