1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-29 05:57:37 +02:00

avformat/urldecode: fix decoding last char if it was percent encoded

The length check was too strict and if the end of the string was a percent
encoded sequence it did not decode correctly.

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint
2025-09-01 00:21:57 +02:00
parent b0314dc76e
commit 23cf2c5f01

View File

@@ -50,7 +50,7 @@ char *ff_urldecode(const char *url, int decode_plus_sign)
while (s < url_len) {
c = url[s++];
if (c == '%' && s + 2 < url_len) {
if (c == '%' && s + 1 < url_len) {
char c2 = url[s++];
char c3 = url[s++];
if (av_isxdigit(c2) && av_isxdigit(c3)) {