From patchwork Fri Jun 7 19:00:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49687 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:c209:0:b0:460:55fa:d5ed with SMTP id d9csp1229246vqo; Fri, 7 Jun 2024 12:00:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXPmu/TFeUtkSGFFc3rSQRGtSKFYqsdv041dufbXdDMzE1PBXKdFSHVhF/F5WRLZP5123Y49vWr+rBFStS+Xog2WJ2ZFiPsQByL7A== X-Google-Smtp-Source: AGHT+IHOyfOFrwVg2ZWTIipcqyQLkMLuav+dD13IXw3Bf+ZBrWMk5FiKfLR+m5cop6m4Sy+4gSQA X-Received: by 2002:a17:906:2a44:b0:a69:b5:def2 with SMTP id a640c23a62f3a-a6cd561e296mr229555566b.6.1717786851379; Fri, 07 Jun 2024 12:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717786851; cv=none; d=google.com; s=arc-20160816; b=Sgvpu106ViiTwF2jJAV3DyKYt8Ts1KDBbwY9O+EYwPL6Oyv7Xh0WyCy9LJ6+P9nrRA 1WmbcQs4cnyNTbOVZmUSnGgPAZ2nG3vl0XSkLOzWDX/D15iqHL3K3shRvRS47MUyxL0g PelpCKkgJVqUBDmkN30kICEfcl9/rxuov0EmBnDi44cXC6sp0o6+s03m9pXtxpZOlQzp tgEi/mvu3Eb3r50F8gZUdNOzixgn+mRRPxZpfAgsXu9QSa2tXKZ/dkoWc3+1VhDzav+y mxAYkVAVfBKvPkE9F3/W1NaM0S3uqX6QIF2psIzZmVjUuaZ8KmxURywI2EgMsr+qrt5/ IJcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=LKr0g21jtGwzchZ5Z4zx6NrhHQmTKJzRbYbrKwKZ1LM=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=jThQY4FUDopK5J6qLeLCgE5UjjCF+cqp5cSX1tqIu66Slz0W/VK1xdpYxejpXvS2G3 Nq2IE6T01j88/jSeSSC1PPs1lSA3oUVuORhJr79rT0tEvRo4JwRO6Xyjos++ca+MV0C+ HH+dS0q72xtq/Tk7XDKbgWUDsptD30OBzQl9btGOgLy6Ug6XQcd6/qEOmVRZN3RXJaAV VSZfYDgBPhz3roHAYRA3D3KYIEL4WUlZ7xIZqX0TokdpF/e7CTbpJDzxe9GN0ScKWxhk 8oEs7z52lVlw2F8Yu3oKmLiQ5qvxhxEyz9pGUGzhG+DhyELEymCokh+QFV2ZJ7lIxsJG Epmg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=MXtDlDbr; 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 a640c23a62f3a-a6c8074b444si203563766b.1047.2024.06.07.12.00.50; Fri, 07 Jun 2024 12:00:51 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=MXtDlDbr; 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 B6AC568D816; Fri, 7 Jun 2024 22:00:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 42EA968AA84 for ; Fri, 7 Jun 2024 22:00:41 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9252460004 for ; Fri, 7 Jun 2024 19:00:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1717786840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3T+A2qLKEcLt/tuDjEONGzXPTmQv2jvJ916NHF4iAZ4=; b=MXtDlDbrb3Rw56DgwApw5eoD1ogT4MItqhLsk3nV0UdHsxfsmepXAX48h7WMhtXZArWJCV 0RLxgivF1pVmAeEbjs9icFPlvNispZukDnf8MDuKcGAtCNuQWCB4P8xu01Q3A1roVscdFE M3aILGAOdJwucKuOQCEufDEJt1ZlBRwH5EcjkeLyEAn7QN1IeJMahMYnkbOwCBpqwWmJGE y4RSfWP6bwJDtbFu+BkUCu1CTxOQfjQarPxQogCACaInLdBgIBBnMvvB8G5uC/6NU8Vr1x 70KoA67J7gVU7y0uLTNm3vTlEl0aiK/auNWMqJhAS61qepnHZxMH+q2/xCBiCw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 7 Jun 2024 21:00:39 +0200 Message-ID: <20240607190039.1731735-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH v2] avformat/img2dec: assert no pipe on ts_from_file 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: sLguDyMqKLMV Help coverity with CID1500302 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavformat/img2dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index ba523530745..20b1bc31f6a 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -25,6 +25,7 @@ #define _DEFAULT_SOURCE #define _BSD_SOURCE #include +#include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/log.h" #include "libavutil/mem.h" @@ -504,6 +505,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt) pkt->flags |= AV_PKT_FLAG_KEY; if (s->ts_from_file) { struct stat img_stat; + av_assert0(!s->is_pipe); // The ts_from_file option is not supported by piped input demuxers if (stat(filename, &img_stat)) { res = AVERROR(EIO); goto fail;