From patchwork Tue Jan 4 06:11:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Anthony Lemieux X-Patchwork-Id: 33047 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp16716054iog; Mon, 3 Jan 2022 22:11:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqL0pRkxayyP2K0tYLaatC9z71xDB9RrLlUnmilJmj+8oA5JCfsJyMUJYE7q5p8qXsay6p X-Received: by 2002:a50:e601:: with SMTP id y1mr3164370edm.181.1641276701699; Mon, 03 Jan 2022 22:11:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641276701; cv=none; d=google.com; s=arc-20160816; b=f9Qu3v38lepyuGwQe8Y71iX/aIl3N/Vw4rD+e4GTlfH9iO/7exOYNWnRaSs+sSNgj+ QaobfrlWDfwwq8/IdPlPK4U83uEbSMgC6aztPrdjZUg2L9E8yGm/QDcYThefuL1RJ4vC GY+n/ocYfBMaDvp0wflFbxZLV88pE44+2kRD4EretDoZwygsQBaxx7t/LAncNRTMPRlh w1zYBu/9oWpxLxcOVAXSM2keaVDyQCrKWlmBVJzaGDLaaRruiPcM3ATYcN9K+Iv/yWyg tocIBPCXpraJnWAobDIffFzlGT4duncx+uQ3CdpbgkwtjfN427t5CrkdgnvEt43snwnq 2lCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=CXGlkmPSKt98mYCIrNXPWnwglPP0lahG/OgjTBgkUAg=; b=xVXvPqQMxC1PYXwb+TcwJuvpfeQeVpVWj1wsNwSEVCAeY55InZP4YDCuqL/M2S7P0F V+m0RtYNi1f0Fy2D9VvOne+2qvUYuUM5HOwh1t/GKKoVGmUxMJKS390pMOOXzQpxdF7z lHF1+Ge8uhWnispofuwdApOBDgOYlunWd3DWyaQ72xJBwZ/rGwB8yII5oG4FCKw5T5wY MtoeWY63nVCA1oYJd+5qc5ASJXPgX72We9YcDPsIgVLrE1B+lRZlQeiNDFTwgijenTTY Nms0ewRYlYpJUOBIPMCiPBL4PCbcrSVa4Hfgb/nMd4660nzd69tGiA9fKHURP/x+VdWO zckw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id bm25si17402297edb.145.2022.01.03.22.11.41; Mon, 03 Jan 2022 22:11:41 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6221D68B1B8; Tue, 4 Jan 2022 08:11:39 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0686468B117 for ; Tue, 4 Jan 2022 08:11:33 +0200 (EET) Received: by mail-pj1-f53.google.com with SMTP id lr15-20020a17090b4b8f00b001b19671cbebso2064512pjb.1 for ; Mon, 03 Jan 2022 22:11:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7M7ow4Z+JrdD8zK6+fndDJ7toHhFpixW7u2mqtM8YpI=; b=Rk9NRr/8zIg+7JRVbWnw7B+f5FoVlwFGFPyI+SQth3QoHo7C0tZ+5u38Kp3ZclOes2 TZO5iAKKPRSNAkzw/SINZ94FpOtZ6S2MFldhvnpdw/NQWMmCExvgMRxCNlwnpqfLs/g1 U2TEw0ElYRctADpWPD6Z3ZhDYZn5GhJFIE7YOsO5LAUvH38/D7wVWIa3wUW42cpEplP2 R1RpL9RPV2BTR12ycrt5JtwZi6Bw5aB/JIeMS+J9LOVGscqxDIVGurpAXnom1RJo1giS iKo3f/gOrkFreIiDS5p4gbr5eP+v/WEOVjCQtZGXlK9rGF5lf3VyJpx12478jS4zQ9AJ g+3A== X-Gm-Message-State: AOAM532EPBZKUCNaKqQ5eV7ay/UBfYEw7/rNN3kYElVMEQv6IaMgAvaW 6ms9brNEtI0oab2a7VTGtCa3FqxiYAg= X-Received: by 2002:a17:903:2350:b0:149:2efe:393a with SMTP id c16-20020a170903235000b001492efe393amr48660300plh.113.1641276691190; Mon, 03 Jan 2022 22:11:31 -0800 (PST) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id d21sm42010800pfv.45.2022.01.03.22.11.29 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jan 2022 22:11:30 -0800 (PST) Received: by localhost (sSMTP sendmail emulation); Mon, 03 Jan 2022 22:11:28 -0800 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 3 Jan 2022 22:11:27 -0800 Message-Id: <20220104061127.398-1-pal@sandflow.com> X-Mailer: git-send-email 2.34.1.windows.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v1] avformat/imf: fix error CPL root element is absent X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Pierre-Anthony Lemieux Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 8Dk3oeHma8FX From: Pierre-Anthony Lemieux Signed-off-by: Pierre-Anthony Lemieux --- Notes: Found through manual fuzzing. libavformat/imf_cpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/imf_cpl.c b/libavformat/imf_cpl.c index 7055b49ae8..167244a5a2 100644 --- a/libavformat/imf_cpl.c +++ b/libavformat/imf_cpl.c @@ -688,7 +688,7 @@ int ff_imf_parse_cpl_from_xml_dom(xmlDocPtr doc, FFIMFCPL **cpl) } cpl_element = xmlDocGetRootElement(doc); - if (xmlStrcmp(cpl_element->name, "CompositionPlaylist")) { + if ((!cpl_element) || xmlStrcmp(cpl_element->name, "CompositionPlaylist")) { av_log(NULL, AV_LOG_ERROR, "The root element of the CPL is not CompositionPlaylist\n"); ret = AVERROR_INVALIDDATA; goto cleanup;