lavf/ftp: fix possible crash
authorLukasz Marek <lukasz.m.luki@gmail.com>
Wed, 28 Aug 2013 23:54:04 +0000 (01:54 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 29 Aug 2013 00:16:41 +0000 (02:16 +0200)
(cherry picked from commit f3ace37a3b8c93218630a37b7df4dc195f1215a9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/ftp.c

index 6358726..572d4b4 100644 (file)
@@ -133,7 +133,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;
         }