Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Appaji <appaji12368@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Appaji <appaji12368@gmail.com>
Subject: [FFmpeg-devel] [PATCH v1] fftools/ffplay: Resolve input file path before processing
Date: Wed, 14 May 2025 02:28:35 +0530
Message-ID: <20250513205835.306929-1-appaji12368@gmail.com> (raw)

Fixes ticket: https://trac.ffmpeg.org/ticket/11574

Signed-off-by: Appaji <appaji12368@gmail.com>
---
 fftools/ffplay.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 2a572fc3aa..42f0584b55 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -27,6 +27,7 @@
 #include "config_components.h"
 #include <math.h>
 #include <limits.h>
+#include <stdlib.h>
 #include <signal.h>
 #include <stdint.h>
 
@@ -3623,9 +3624,17 @@ static int opt_input_file(void *optctx, const char *filename)
                 filename, input_filename);
         return AVERROR(EINVAL);
     }
-    if (!strcmp(filename, "-"))
+
+    char resolved_path[PATH_MAX];
+
+    if (!realpath(filename, resolved_path)) {
+        av_log(NULL, AV_LOG_FATAL, "Failed to resolve path for '%s': %s\n", filename, strerror(errno));
+        return AVERROR(errno);
+    }
+
+    if (!strcmp(resolved_path, "-"))
         filename = "fd:";
-    input_filename = av_strdup(filename);
+    input_filename = av_strdup(resolved_path);
     if (!input_filename)
         return AVERROR(ENOMEM);
 
-- 
2.43.0

_______________________________________________
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".

             reply	other threads:[~2025-05-13 20:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13 20:58 Appaji [this message]
2025-05-14 11:49 ` Nicolas George
2025-05-14 18:06   ` Marton Balint
2025-05-15 19:54     ` Appaji Chintimi
2025-05-21  5:17       ` Appaji Chintimi
2025-05-21  6:50         ` Nicolas George

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250513205835.306929-1-appaji12368@gmail.com \
    --to=appaji12368@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git