[libav-stable] avplay: Always free find_stream_info options

Luca Barbato git at libav.org
Fri Oct 17 11:04:13 CEST 2014


Module: libav
Branch: master
Commit: cf83c0173917a44b89a25ea2b435429bbf9ee767

Author:    Luca Barbato <lu_zero at gentoo.org>
Committer: Vittorio Giovara <vittorio.giovara at gmail.com>
Date:      Tue Oct 14 16:46:38 2014 +0100

avplay: Always free find_stream_info options

CC: libav-stable at libav.org
Bug-Id: CID 1238794

---

 avplay.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/avplay.c b/avplay.c
index 4a7759b..0eb6fb2 100644
--- a/avplay.c
+++ b/avplay.c
@@ -2266,14 +2266,16 @@ static int decode_thread(void *arg)
     orig_nb_streams = ic->nb_streams;
 
     err = avformat_find_stream_info(ic, opts);
+
+    for (i = 0; i < orig_nb_streams; i++)
+        av_dict_free(&opts[i]);
+    av_freep(&opts);
+
     if (err < 0) {
         fprintf(stderr, "%s: could not find codec parameters\n", is->filename);
         ret = -1;
         goto fail;
     }
-    for (i = 0; i < orig_nb_streams; i++)
-        av_dict_free(&opts[i]);
-    av_freep(&opts);
 
     if (ic->pb)
         ic->pb->eof_reached = 0; // FIXME hack, avplay maybe should not use url_feof() to test for the end



More information about the libav-stable mailing list