mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 10:30:05 +01: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:
@@ -50,7 +50,7 @@ char *ff_urldecode(const char *url, int decode_plus_sign)
|
|||||||
while (s < url_len) {
|
while (s < url_len) {
|
||||||
c = url[s++];
|
c = url[s++];
|
||||||
|
|
||||||
if (c == '%' && s + 2 < url_len) {
|
if (c == '%' && s + 1 < url_len) {
|
||||||
char c2 = url[s++];
|
char c2 = url[s++];
|
||||||
char c3 = url[s++];
|
char c3 = url[s++];
|
||||||
if (av_isxdigit(c2) && av_isxdigit(c3)) {
|
if (av_isxdigit(c2) && av_isxdigit(c3)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user