[FFmpeg-devel] [PATCH] avformat/ftp: Exit with error on ftp_open if file does not exist
Michael Niedermayer
michael at niedermayer.cc
Sat Dec 28 16:17:16 EET 2019
On Sat, Dec 28, 2019 at 01:52:04PM +0300, Fotyev V. wrote:
> Add a check for code 550 when requesting file size
> ---
> libavformat/ftp.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/ftp.c b/libavformat/ftp.c
> index 97ad80d..64a5250 100644
> --- a/libavformat/ftp.c
> +++ b/libavformat/ftp.c
> @@ -391,13 +391,17 @@ static int ftp_file_size(FTPContext *s)
> char command[CONTROL_BUFFER_SIZE];
> char *res = NULL;
> static const int size_codes[] = {213, 0};
> + int resp_code;
>
> snprintf(command, sizeof(command), "SIZE %s\r\n", s->path);
> - if (ftp_send_command(s, command, size_codes, &res) == 213 && res &&
> strlen(res) > 4) {
> + resp_code = ftp_send_command(s, command, size_codes, &res);
patch is corrupted by newlines
[...]
thx
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191228/736274af/attachment.sig>
More information about the ffmpeg-devel
mailing list