From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id EF38C440EF for ; Fri, 26 Aug 2022 03:22:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 136CC68B9F3; Fri, 26 Aug 2022 06:22:18 +0300 (EEST) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1A78C68B9CA for ; Fri, 26 Aug 2022 06:22:12 +0300 (EEST) Received: by mail-pj1-f50.google.com with SMTP id w88-20020a17090a6be100b001fbb0f0b013so312442pjj.5 for ; Thu, 25 Aug 2022 20:22:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=eIPq42vnvfSm1pZyJRD7NuXPzdQsMbzWmY+wlboi6ik=; b=kPE5NnDaQ4kRrDCc0uTPvcrZ8XpyQi6UYoAGBVuxjjACiwqjpPljnLTTNLQeqHox+z P3cNiJ19HvynXBdDlfmXW1SwAm1z7nwSY7zj61K0BemY3yAgJbpiqLcOqXLoa1pfCsuY +p3PM8xkDUn6UDW5SxngF/HRo8Yc5R8WcvY4q1ThyKlmFg3GjBA+RbikHvXa+M3V0pxN zSxenhk8bXP9VzzIXlytzaRaSpDMcvdOh91jVzZ3EYUXGmMoLx2BGsLlHc2g4GH8x5Vi XKRDCbmBVOOG8Tq1rWfe3gCAQ6gQDD439jQdGkfpYmUwkb8EOTZZE9sIMmLHSUCH5uD6 A/0A== X-Gm-Message-State: ACgBeo3TY5dSbp3WcmROkuIv/y1X4yuFloMeynUifpcfRTZt6ixTAhyl 6AJbIYtNIkzje2nGF6N+BLQJeC3b15Q= X-Google-Smtp-Source: AA6agR4pE1hUejhUYuuKDQ5E4B7tl/Rsv4bOe29KpOF4HdylTkLAAcdLEs14hKnhVRov4tPpPQZ5uA== X-Received: by 2002:a17:90b:4b0d:b0:1fa:e712:dd53 with SMTP id lx13-20020a17090b4b0d00b001fae712dd53mr2221006pjb.10.1661484129794; Thu, 25 Aug 2022 20:22:09 -0700 (PDT) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id n7-20020a170902e54700b0016a6caacaefsm318193plf.103.2022.08.25.20.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 20:22:09 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Thu, 25 Aug 2022 20:21:55 -0700 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Aug 2022 20:21:53 -0700 Message-Id: <20220826032153.29482-1-pal@sandflow.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v1] avformat/imfdec: check if Asset/Id exists before trying to read it 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Pierre-Anthony Lemieux Fixes Coverity issue #1512406 --- libavformat/imfdec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 5bbe7a53f8..fde91a6419 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -233,7 +233,12 @@ static int parse_imf_asset_map_from_xml_dom(AVFormatContext *s, asset = &(asset_map->assets[asset_map->asset_count]); - if (ff_imf_xml_read_uuid(ff_imf_xml_get_child_element_by_name(asset_element, "Id"), asset->uuid)) { + if (!(node = ff_imf_xml_get_child_element_by_name(asset_element, "Id"))) { + av_log(s, AV_LOG_ERROR, "Unable to parse asset map XML - missing Id node\n"); + return AVERROR_INVALIDDATA; + } + + if (ff_imf_xml_read_uuid(node, asset->uuid)) { av_log(s, AV_LOG_ERROR, "Could not parse UUID from asset in asset map.\n"); return AVERROR_INVALIDDATA; } -- 2.25.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".