Commit 93b67ff937 for ffmpeg

commit 93b67ff937bc93154721071259c5d936e4d07e32
Author: Tim Rae <perceptualchaos2@gmail.com>
Date:   Thu Nov 12 08:47:32 2026 +0900

    fate/libavformat: add a test for libssh URL path decoding

    Cover plain paths, %20 and %2520, '+' (not decoded), invalid and
    truncated escapes, encoded slashes, and the rejection of %00.

    Signed-off-by: Tim Rae <perceptualchaos2@gmail.com>

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5d8d0d17a5..5a9570031d 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -804,6 +804,7 @@ TESTPROGS                                       += $(HTTP_NOBODY_TESTPROG-yes)
 TESTPROGS-$(CONFIG_NETWORK)              += noproxy
 TESTPROGS-$(CONFIG_SRTP)                 += srtp
 TESTPROGS-$(CONFIG_IMF_DEMUXER)          += imf
+TESTPROGS-$(CONFIG_LIBSSH_PROTOCOL)      += libssh
 TESTPROGS-$(CONFIG_MP3_MUXER)            += id3v2enc id3v2chap
 TESTPROGS-$(CONFIG_AU_MUXER)             += auenc
 TESTPROGS-$(CONFIG_MPEGTS_DEMUXER)       += mpegts_probe
diff --git a/libavformat/tests/.gitignore b/libavformat/tests/.gitignore
index cc9e26a2af..355b8924b5 100644
--- a/libavformat/tests/.gitignore
+++ b/libavformat/tests/.gitignore
@@ -4,6 +4,7 @@
 /id3v2enc
 /fifo_muxer
 /imf
+/libssh
 /mpegts_probe
 /mkdir
 /noproxy
diff --git a/libavformat/tests/libssh.c b/libavformat/tests/libssh.c
new file mode 100644
index 0000000000..5309e85611
--- /dev/null
+++ b/libavformat/tests/libssh.c
@@ -0,0 +1,49 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdio.h>
+
+#include "libavformat/libssh.c"
+
+static void test_decode_path(const char *in)
+{
+    char path[MAX_URL_SIZE];
+    int ret;
+
+    av_strlcpy(path, in, sizeof(path));
+    ret = libssh_decode_path(path, sizeof(path));
+    if (ret < 0)
+        printf("\"%s\" -> rejected\n", in);
+    else
+        printf("\"%s\" -> \"%s\"\n", in, path);
+}
+
+int main(void)
+{
+    test_decode_path("");
+    test_decode_path("/plain/path.mkv");
+    test_decode_path("/My%20Movie.mkv");
+    test_decode_path("/My%2520Movie.mkv");
+    test_decode_path("/a+b.mkv");
+    test_decode_path("/100%zz.mkv");
+    test_decode_path("/trailing%2");
+    test_decode_path("/x%2Fy%2fz");
+    test_decode_path("/a%00b.mkv");
+    test_decode_path("%00");
+    return 0;
+}
diff --git a/tests/fate/libavformat.mak b/tests/fate/libavformat.mak
index c92f9e2df8..69b5a0f73d 100644
--- a/tests/fate/libavformat.mak
+++ b/tests/fate/libavformat.mak
@@ -64,6 +64,10 @@ FATE_LIBAVFORMAT-$(CONFIG_HTTP_PROTOCOL) += fate-httpcookie
 fate-httpcookie: libavformat/tests/httpcookie$(EXESUF)
 fate-httpcookie: CMD = run libavformat/tests/httpcookie$(EXESUF)

+FATE_LIBAVFORMAT-$(CONFIG_LIBSSH_PROTOCOL) += fate-libssh-decode-path
+fate-libssh-decode-path: libavformat/tests/libssh$(EXESUF)
+fate-libssh-decode-path: CMD = run libavformat/tests/libssh$(EXESUF)
+
 FATE_LIBAVFORMAT-$(CONFIG_NETWORK) += fate-noproxy
 fate-noproxy: libavformat/tests/noproxy$(EXESUF)
 fate-noproxy: CMD = run libavformat/tests/noproxy$(EXESUF)
diff --git a/tests/ref/fate/libssh-decode-path b/tests/ref/fate/libssh-decode-path
new file mode 100644
index 0000000000..af364f2574
--- /dev/null
+++ b/tests/ref/fate/libssh-decode-path
@@ -0,0 +1,10 @@
+"" -> ""
+"/plain/path.mkv" -> "/plain/path.mkv"
+"/My%20Movie.mkv" -> "/My Movie.mkv"
+"/My%2520Movie.mkv" -> "/My%20Movie.mkv"
+"/a+b.mkv" -> "/a+b.mkv"
+"/100%zz.mkv" -> "/100%zz.mkv"
+"/trailing%2" -> "/trailing%2"
+"/x%2Fy%2fz" -> "/x/y/z"
+"/a%00b.mkv" -> rejected
+"%00" -> rejected