From patchwork Sat May 9 08:50:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao, Gang" X-Patchwork-Id: 19575 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 1999F449A32 for ; Sat, 9 May 2020 11:51:58 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E652D689BB1; Sat, 9 May 2020 11:51:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0676F687F66 for ; Sat, 9 May 2020 11:51:51 +0300 (EEST) Received: by mail-pf1-f180.google.com with SMTP id 145so2223649pfw.13 for ; Sat, 09 May 2020 01:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=oNwhhGmWhkcWGVX8vY/9hURR1AfQJrLlIpzxcgMSX/E=; b=DqKKIxMVUTotFVYBHrOUZriYg/9ayaT1FaLZidMPPyEcTVwo9XYaHSDHgaRh90DqMB dc+QHmNb3RebArTkdPNoDUVLh0uFfAd4WeMvHFP6hAXO8i2/4iOd+7qlNAzqOOAMOdnO dLlg2foDeYcQkmtcXbEPIPQz/V0kLDtyyvK3UAD2DsiIAX0DvDRGssneP6mYg+Mmlusw qVUylz+Y7Hsoqu2WCEFekgtJoIU5ZIMnRgHv3JazZdN/z+RNtCguELuURo/E+znrewrW MBUx41txxarmLTyvahkIXfl6mNic3H67gP7d7H4/WI9YjhQ8MJ/y6jLScAKTGPPqVAwN MoIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=oNwhhGmWhkcWGVX8vY/9hURR1AfQJrLlIpzxcgMSX/E=; b=ebc8gn04JT2uW2RSJOWpreXytbKYaCQxLG0C60mjDdbyc0u5u773TcDqvVmrJ1ZZA4 tRnmY2HHyrM3N5gWyqOvktczGvTI33q2eAScyLoi6jf1v3pyNPuMzawZJbYrCrzzlFsi p+Em5gNDXo/5S/HFBuD97A4nko8GkIwqDG840qQIaziND/Vt7nOt3k3HcNgRp0YiPOuA fkz1hI83ugiLgE0n2Su8wfSFO5AzkYMB/rS7zdclMRs59+7NfYp41nupIgl7XuFxSoN5 5pyd43ikv6Pbj4vRdyKoP+wEeD/r9EGJ9afHhMZ48yIADuRm9J9vNCL13JFlO2E1e/E2 gGFA== X-Gm-Message-State: AGi0PuZuQxvvUrYJteSDLUM9Rwh6yIquQBmz6rrfBg1Xgt2Or7SnYJDB UAy+fWgUVHpsRWbteSF6YktBHyHlqBE= X-Google-Smtp-Source: APiQypJy0baaVnQy4GGpsWg9TQjSoAYYMPDmdgGm7U+aoydPDz1iL9lJe+pm/fNmLVAE3QY4YcP5Fg== X-Received: by 2002:a63:7e5a:: with SMTP id o26mr1234389pgn.134.1589014308650; Sat, 09 May 2020 01:51:48 -0700 (PDT) Received: from localhost.localdomain ([2600:3c01::f03c:91ff:feee:c20d]) by smtp.gmail.com with ESMTPSA id a138sm4031946pfd.32.2020.05.09.01.51.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 01:51:47 -0700 (PDT) From: "Zhao, Gang" To: Date: Sat, 9 May 2020 16:50:47 +0800 Message-Id: X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/3] avformat: Correctly check the list before accessing 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Zhao, Gang --- libavformat/allformats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git libavformat/allformats.c libavformat/allformats.c index 3919c9e4c1..47cf885699 100644 --- libavformat/allformats.c +++ libavformat/allformats.c @@ -520,7 +520,7 @@ const AVOutputFormat *av_muxer_iterate(void **opaque) if (i < size) { f = muxer_list[i]; - } else if (indev_list) { + } else if (outdev_list) { f = outdev_list[i - size]; } @@ -537,7 +537,7 @@ const AVInputFormat *av_demuxer_iterate(void **opaque) if (i < size) { f = demuxer_list[i]; - } else if (outdev_list) { + } else if (indev_list) { f = indev_list[i - size]; }