From f3ace37a3b8c93218630a37b7df4dc195f1215a9 Mon Sep 17 00:00:00 2001 From: Lukasz Marek Date: Thu, 29 Aug 2013 01:54:04 +0200 Subject: lavf/ftp: fix possible crash --- libavformat/ftp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/ftp.c b/libavformat/ftp.c index c73319d5f3..eb3827fa35 100644 --- a/libavformat/ftp.c +++ b/libavformat/ftp.c @@ -128,7 +128,8 @@ static int ftp_status(FTPContext *s, char **line, const int response_codes[]) while (!code_found || dash) { if ((err = ftp_get_line(s, buf, sizeof(buf))) < 0) { - av_bprint_finalize(&line_buffer, NULL); + if (line) + av_bprint_finalize(&line_buffer, NULL); return err; } -- cgit v1.2.3