diff mbox series

[FFmpeg-devel,1/4] avformat/format: Remove redundant FFMIN() in ff_match_url_ext()

Message ID 20230516004918.13505-1-michael@niedermayer.cc
State Accepted
Commit 19a74bc794e6cf8a9a9b59df9ccff03f85d4a34f
Headers show
Series [FFmpeg-devel,1/4] avformat/format: Remove redundant FFMIN() in ff_match_url_ext() | expand

Commit Message

Michael Niedermayer May 16, 2023, 12:49 a.m. UTC
Found-by: Leo Izen

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/format.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer May 21, 2023, 8:42 p.m. UTC | #1
On Tue, May 16, 2023 at 02:49:15AM +0200, Michael Niedermayer wrote:
> Found-by: Leo Izen
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/format.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patchset

[...]
diff mbox series

Patch

diff --git a/libavformat/format.c b/libavformat/format.c
index d9135854de..c91f71057a 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -70,7 +70,7 @@  int ff_match_url_ext(const char *url, const char *extensions)
         return 0;
     if (uc.query - ext > sizeof(scratchpad))
         return AVERROR(ENOMEM); //not enough memory in our scratchpad
-    av_strlcpy(scratchpad, ext + 1, FFMIN(sizeof(scratchpad), uc.query - ext));
+    av_strlcpy(scratchpad, ext + 1, uc.query - ext);
 
     return av_match_name(scratchpad, extensions);
 }