[FFmpeg-devel] [PATCH] libavformat: increase MAX_URL_SIZE

WooDzu woodzu123 at gmail.com
Sat Oct 28 16:04:38 EEST 2023


With the rise of object storage, like S3, it is not uncommon to generate
long pre-signed URLs. When a pre-signed URL is generated using a
short-lived credentials it may include a query parameter called
X-Amz-Security-Token that is 4kB on its own.
The current MAX_URL_SIZE will trim the URL with no any errors or
warnings and the request will fail with a http 400 error.

Signed-off-by: Piotr Gasiorowski <piotr at lwks.com>
---
  libavformat/internal.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index 7702986c9c..d6465bad7c 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -27,7 +27,7 @@
   #include "avformat.h"
  -#define MAX_URL_SIZE 4096
+#define MAX_URL_SIZE 8192
   /** size of probe buffer, for guessing file type from file contents */
  #define PROBE_BUF_MIN 2048
-- 
2.39.2 (Apple Git-143)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libavformat-increase-MAX_URL_SIZE.patch
Type: text/x-patch
Size: 1091 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20231028/f393579e/attachment.bin>


More information about the ffmpeg-devel mailing list