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 D1CB1490EC for ; Mon, 3 Jun 2024 02:15:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6973068D669; Mon, 3 Jun 2024 05:15:34 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2670668D616 for ; Mon, 3 Jun 2024 05:15:28 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4AA8140002 for ; Mon, 3 Jun 2024 02:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1717380927; 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=L9HsZ5Ei2F7AmCm/mKLqE86mpLD9/U1J9TDW5iwMKfc=; b=IwfGyIDNLfW5MaXuMYRTyEonzoHwGiZVq0AjUO8LDlsf7omO1ldGW0C+BX8AsxRy3LqhPR Bzy+iXZzbeKR8Wge6SKmidiOpLA5ZTlOXPqjJwcPoYpg59TpSAjVVJY/R08EqLNyfZClzw IAJpEsPfxtsPPK4dukZJJYOCX5NTQGP1EIhowT8K0iwt1v/5Fb0Q1RQHl47CnDl5Zk9X45 YPnArCl3oEJUMODBubKyYn7a6ZMbB/C6icgVKjPuBTjWZLEJX7uwv92pK/gJJLTW9BeBVE MBExDkJKjcazVjtePIKbuoxQdcK2mJN+IwXYhvV4gAAAXd1S/LVMqTup/KP+oQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 3 Jun 2024 04:15:18 +0200 Message-ID: <20240603021526.2372698-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/9] avdevice/xcbgrab: Check sscanf() return 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 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: Alot more input checking can be performed, this is only checking the obvious missing case Fixes: CID1598562 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavdevice/xcbgrab.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavdevice/xcbgrab.c b/libavdevice/xcbgrab.c index 2e6b118d8c0..c736ec0cbcb 100644 --- a/libavdevice/xcbgrab.c +++ b/libavdevice/xcbgrab.c @@ -828,7 +828,10 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s) if (!sscanf(s->url, "%[^+]+%d,%d", display_name, &c->x, &c->y)) { *display_name = 0; - sscanf(s->url, "+%d,%d", &c->x, &c->y); + if(sscanf(s->url, "+%d,%d", &c->x, &c->y) != 2) { + if (*s->url) + av_log(s, AV_LOG_WARNING, "Ambigous URL: %s\n", s->url); + } } c->conn = xcb_connect(display_name[0] ? display_name : NULL, &screen_num); -- 2.45.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".