ffplay: fix mem leak when opening input or parsing options fail.
authorBenoit Fouet <benoit.fouet@free.fr>
Fri, 21 Nov 2014 08:45:42 +0000 (09:45 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 22 Nov 2014 14:55:07 +0000 (15:55 +0100)
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffplay.c

index f79161d..1914a66 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -3169,8 +3169,9 @@ static int read_thread(void *arg)
         stream_component_close(is, is->video_stream);
     if (is->subtitle_stream >= 0)
         stream_component_close(is, is->subtitle_stream);
-    if (is->ic) {
-        avformat_close_input(&is->ic);
+    if (ic) {
+        avformat_close_input(&ic);
+        is->ic = NULL;
     }
 
     if (ret != 0) {